Uh oh!
There was an error while loading. Please reload this page.
Added Cookie Header to XML and Websocket request - #10575
Conversation
facebook-github-bot
commented
Oct 27, 2016
lacker
commented
Oct 29, 2016
Why is this the right behavior? It's not clear to me that these libraries should automatically use cookies. FWIW #9114 is a similar pull request. |
clozr
commented
Oct 29, 2016
Fetch & Websocket API should be a drop-in replacement for the web version of the code. |
lacker
commented
Nov 7, 2016
I accepted #9114 for websockets since that had already been reviewed by a bunch of folks, so I think you will need to update this to just center on non websocket things. |
clozr
commented
Nov 7, 2016
lacker
commented
Nov 7, 2016
OK sounds good to me. |
lacker
commented
Nov 30, 2016
Hey, so I am unclear on the status of this, maybe I wasn't specific enough. With #9114 does this PR need to be updated, or do you think it's ready to go right now? In particular I am curious how we should test given the two different PRs that the behavior is the same cross-platform. |
clozr
commented
Dec 8, 2016
@lacker I reviewed the #9114, that PR fixes sending cookie header in websocket request for android websocket. This PR also does the same for IOS side. Since the test for #9114 was written in JS and platform agnostics, same test also works for this PR. |
lacker
commented
Dec 8, 2016
Can you make this be tested automatically? It seems like that manual procedure in the other pull request, nobody is ever going to do that. |
hramos
commented
Jan 19, 2017
Ping @clozr, see earlier feedback. |
clozr
commented
Jan 21, 2017
To test automatically we will need a test mode callback to examine the headers being sent for websocket connect request. Give me couple of days to do it. |
ycai2
commented
Mar 29, 2017
Is this PR ready to be merged? @clozr |
GrigoryPtashko
commented
Apr 26, 2017
I side up with everybody who's waiting for this feature. Are there any plans on when this PR is going to be merged? |
shergin
commented
Apr 26, 2017
I believe we should merge this. |
facebook-github-bot
commented
Apr 26, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Apr 27, 2017
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
facebook-github-bot
commented
May 5, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
1 similar comment
facebook-github-bot
commented
May 5, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
shergin
commented
May 7, 2017
@clozr Looks like we have weird difficulties with merging this PR. Could you please rebase it on master? |
22a2a5e to
d3b3c35Compareclozr
commented
May 8, 2017
Just updated the PR to facebook/master. Please let me know if you come across any problem |
facebook-github-bot
commented
May 8, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
ycai2
commented
May 18, 2017
@clozr It seems like this PR can't be merged. Could you take a look at the build failure? |
3b6849a to
15a9471Compareclozr
commented
May 18, 2017
Looks like there were some unrelated issues. I have rebased it again. Let's see how the current build goes. |
facebook-github-bot
commented
May 18, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
clozr
commented
May 18, 2017
Looks Good now |
shergin
left a comment
There was a problem hiding this comment.
I am soooory for late detailed review but code style should be fixed.
| callbackQueue.maxConcurrentOperationCount = 1; | ||
| callbackQueue.underlyingQueue = [[_bridge networking] methodQueue]; | ||
| NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; | ||
| [ configuration setHTTPShouldSetCookies:YES]; |
There was a problem hiding this comment.
Please, fix codestyle across all changed lines. This diff cannot be merged without it (because of linter).
| NSDictionary* headers = [RCTConvert NSDictionary:query[@"headers"]]; | ||
| [headers enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { | ||
| //request.allHTTPHeaderFields = [self stripNullsInRequestHeaders:[RCTConvert NSDictionary:query[@"headers"]]]; | ||
| if(value) { |
| // set supplied headers | ||
| NSDictionary* headers = [RCTConvert NSDictionary:query[@"headers"]]; | ||
| [headers enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { | ||
| //request.allHTTPHeaderFields = [self stripNullsInRequestHeaders:[RCTConvert NSDictionary:query[@"headers"]]]; |
| // fetch). To get secure cookies for wss URLs, replace wss with https | ||
| // in the URL. | ||
| NSURLComponents *components = [NSURLComponents componentsWithURL:URL resolvingAgainstBaseURL:true]; | ||
| if ([[components.scheme lowercaseString] isEqualToString:@"wss"]) { |
There was a problem hiding this comment.
Please, use dot notation for lowercaseString.
| if ([[components.scheme lowercaseString] isEqualToString:@"wss"]) { | ||
| components.scheme = @"https"; | ||
| } | ||
| // Load and set the cookie header. |
| // Load and set the cookie header. | ||
| NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:URL]; | ||
| request.allHTTPHeaderFields = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies]; | ||
| request.allHTTPHeaderFields = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies]; | ||
| // set supplied headers |
There was a problem hiding this comment.
Capital letter, full stop at the end.
| // set supplied headers | ||
| NSDictionary* headers = [RCTConvert NSDictionary:query[@"headers"]]; |
clozr
commented
May 19, 2017
Fixed the lint errors. Let me know any more issues |
facebook-github-bot
commented
May 19, 2017
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Continuation of Pull Request #7167
#7167
Needed to clean my repository. So created this Pull Request