Skip to content

Commit e09bf04

Browse files
ej3facebook-github-bot
authored andcommitted
RNTester http_server send cookie fix
Summary: Signed-off-by: Evan J Brunner <ej3@appitto.me> <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Motivation can be found in #17899 This `RNTester/js/http_test_server.js` is part of a internal websocket test suite / devtool. Can be tested with `curl -D - localhost:5556` observing that the `Set-Cookie: wstest=OK; Path=\` header is present, and the service throws no exceptions.. etc [INTERNAL][MINOR][./RNTester/js/http_test_server.js] - fixed set cookie with connect framework <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> Closes facebook/react-native#17900 Differential Revision: D6977087 Pulled By: hramos fbshipit-source-id: af6205343fccf69c57e0c26a85a5b04d61288a23
1 parent 86f8b7c commit e09bf04

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

js/http_test_server.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ const app = connect();
3030

3131
app.use(function(req, res) {
3232
console.log('received request');
33-
const cookieOptions = {
34-
//httpOnly: true, // the cookie is not accessible by the user (javascript,...)
35-
secure: false, // allow HTTP
36-
};
37-
res.cookie('wstest', 'OK', cookieOptions);
33+
res.setHeader('Set-Cookie', ['wstest=OK; Path=/']);
3834
res.end('Cookie has been set!\n');
3935
});
4036

0 commit comments

Comments
 (0)