Skip to content

fix bind error to enable submitting cookies in CORS requests#1236

Merged
shockey merged 3 commits intoswagger-api:masterfrom
renuka-fernando:issue
Feb 3, 2018
Merged

fix bind error to enable submitting cookies in CORS requests#1236
shockey merged 3 commits intoswagger-api:masterfrom
renuka-fernando:issue

Conversation

@renuka-fernando
Copy link
Copy Markdown
Contributor

@renuka-fernando renuka-fernando commented Jan 30, 2018

  • Removed this.http.bind statement
  • Documentation is updated.

Description

  • The statement will not assign the withCredentials value of http function to the new http variable.
  • Below is the test run in console.
>  this.http
<- ƒ http(url) {
     var request = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

     if ((typeof url === 'undefined' ? 'undefined' : (0, _typeof3.default)(url)) === 'object') {
     
>  this.http.withCredentials
<- true
>  var bindedHttp = this.http.bind(this);
<- undefined
>  bindedHttp.withCredentials
<- undefined
  • No method consumes this.'any_property' in the http (i.e.src/http.js) method. No use of binding.

Motivation and Context

How Has This Been Tested?

  • Tested with two origins.
  • UI running on localhost:9292 sends requests to the server on localhost:9293.

Screenshots (if appropriate):

  • Please refer the console area
    bind_error

Types of changes

  • No code changes (changes to documentation, CI, metadata, etc)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@shockey shockey added this to the February 2, 2018 milestone Feb 1, 2018
@shockey shockey merged commit 9d6e189 into swagger-api:master Feb 3, 2018
@shockey
Copy link
Copy Markdown
Contributor

shockey commented Feb 3, 2018

Thanks, @RenukaFernando! This will ship tonight.

@renuka-fernando
Copy link
Copy Markdown
Contributor Author

Thanks, @shockey

@renuka-fernando renuka-fernando deleted the issue branch February 3, 2018 11:10
rook2pawn pushed a commit to rook2pawn/swagger-js that referenced this pull request Feb 20, 2018
…r-api#1236)

* fix bind error to enable submitting cookies in CORS requests

* correct documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In CORS requests Cookies are not submitted nor setting correctly

2 participants