Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie handling contains bugs #104

Merged
merged 5 commits into from Nov 30, 2011
Merged

Cookie handling contains bugs #104

merged 5 commits into from Nov 30, 2011

Conversation

janjongboom
Copy link
Contributor

@mikeal See my inline comments on this pull request.

@@ -151,7 +151,13 @@ Request.prototype.request = function () {
// fetch cookie from the global cookie jar
var cookies = cookieJar.get({ url: self.uri.href })
}
if (cookies) {self.headers.Cookie = cookies}
if (cookies) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cookies has to be a string, this way an array is put into cookies; resulting in multiple 'Cookie' headers. This isn't on spec.

@indexzero
Copy link

+1 Seeing this error:

{ stack: 
   [ 'TypeError: Cannot read property \'url\' of undefined',
     '    at new Cookie (/some-project/node_modules/request/vendor/cookie/index.js:45:20)',
     '    at /some-project/node_modules/request/main.js:432:33',
     '    at Array.forEach (native)',
     '    at Request.<anonymous> (/some-project/node_modules/request/main.js:426:46)',
     '    at Request.emit (events.js:64:17)',
     '    at IncomingMessage.<anonymous> (/some-project/node_modules/request/main.js:391:16)',
     '    at IncomingMessage.emit (events.js:81:20)',
     '    at HTTPParser.onMessageComplete (http.js:133:23)',
     '    at Socket.ondata (http.js:1231:22)',
     '    at Socket._onReadable (net.js:677:27)' ] }

@kitek
Copy link

kitek commented Nov 18, 2011

@indexzero I probably fixed that error: https://github.com/mikeal/request/pull/106/files

@mikeal
Copy link
Member

mikeal commented Nov 29, 2011

what's the status on this pull request? there are some comments which I don't believe are resolved and there is also a change that has already been merged which i believe addresses some of the problems.

@janjongboom
Copy link
Contributor Author

This pull request is still active. The other pull request about cookies was about the way it handled the Path header. This pull request covers:

  • Sending cookies from the jar in the correct syntax
  • Storing cookies that are set by requests with other response codes than 200

@mikeal
Copy link
Member

mikeal commented Nov 30, 2011

sorry, i mistook the inline comments as unresolved issues, didn't realize at first that you were using them to describe the changes :)

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.

None yet

4 participants