Skip to content

Commit

Permalink
Merge pull request #16 from michaelwittig/master
Browse files Browse the repository at this point in the history
secureProxy option added
  • Loading branch information
jed committed Sep 14, 2012
2 parents b167c7c + 1a90216 commit 4f8d442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ If the _options_ object is provided, it will be used to generate the outbound co
* `path`: a string indicating the path of the cookie (`/` by default). * `path`: a string indicating the path of the cookie (`/` by default).
* `domain`: a string indicating the domain of the cookie (no default). * `domain`: a string indicating the domain of the cookie (no default).
* `secure`: a boolean indicating whether the cookie is only to be sent over HTTPS (`false` by default for HTTP, `true` by default for HTTPS). * `secure`: a boolean indicating whether the cookie is only to be sent over HTTPS (`false` by default for HTTP, `true` by default for HTTPS).
* `secureProxy`: a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL not in your node process).
* `httpOnly`: a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (`true` by default). * `httpOnly`: a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (`true` by default).
* `signed`: a boolean indicating whether the cookie is to be signed (`false` by default). If this is true, another cookie of the same name with the `.sig` suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of _cookie-name_=_cookie-value_ against the first [Keygrip](https://github.com/jed/keygrip) key. This signature key is used to detect tampering the next time a cookie is received. * `signed`: a boolean indicating whether the cookie is to be signed (`false` by default). If this is true, another cookie of the same name with the `.sig` suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of _cookie-name_=_cookie-value_ against the first [Keygrip](https://github.com/jed/keygrip) key. This signature key is used to detect tampering the next time a cookie is received.


Expand Down Expand Up @@ -112,4 +113,4 @@ Copyright


Copyright (c) 2012 Jed Schmidt. See LICENSE.txt for details. Copyright (c) 2012 Jed Schmidt. See LICENSE.txt for details.


Send any questions or comments [here](http://twitter.com/jedschmidt). Send any questions or comments [here](http://twitter.com/jedschmidt).
1 change: 1 addition & 0 deletions lib/cookies.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Cookies.prototype = {


cookie.secure = secure cookie.secure = secure
if (opts && "secure" in opts) cookie.secure = opts.secure if (opts && "secure" in opts) cookie.secure = opts.secure
if (opts && "secureProxy" in opts) cookie.secure = opts.secureProxy
headers.push(cookie.toHeader()) headers.push(cookie.toHeader())


if (opts && signed) { if (opts && signed) {
Expand Down

0 comments on commit 4f8d442

Please sign in to comment.