From 03e6d3efb43a9d5dc9a98b253f3210932503f2d6 Mon Sep 17 00:00:00 2001 From: Evan J Brunner Date: Tue, 13 Feb 2018 10:41:29 -0800 Subject: [PATCH] RNTester http_server send cookie fix Summary: Signed-off-by: Evan J Brunner 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 Closes https://github.com/facebook/react-native/pull/17900 Differential Revision: D6977087 Pulled By: hramos fbshipit-source-id: af6205343fccf69c57e0c26a85a5b04d61288a23 --- RNTester/js/http_test_server.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/RNTester/js/http_test_server.js b/RNTester/js/http_test_server.js index 7af1f052e..c22221217 100755 --- a/RNTester/js/http_test_server.js +++ b/RNTester/js/http_test_server.js @@ -30,11 +30,7 @@ const app = connect(); app.use(function(req, res) { console.log('received request'); - const cookieOptions = { - //httpOnly: true, // the cookie is not accessible by the user (javascript,...) - secure: false, // allow HTTP - }; - res.cookie('wstest', 'OK', cookieOptions); + res.setHeader('Set-Cookie', ['wstest=OK; Path=/']); res.end('Cookie has been set!\n'); });