Skip to content

Commit

Permalink
Stomp set-cookie
Browse files Browse the repository at this point in the history
set-cookie causes the cache to not cache the page. Since we’re not trying to track the user beyond, we don’t want to try resetting the cookie again with the same info
  • Loading branch information
colbygk committed Dec 1, 2017
1 parent 1083a7a commit c65b0ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/lib/fastly-config-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ var FastlyConfigMethods = {
'if (' + condition + ') {\n' +
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionsid) {\n' +
' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' +
' unset beresp.http.set-cookie;\n' +
' return(deliver);\n' +
' } else {\n' +
' set beresp.ttl = 0s;\n' +
' set beresp.grace = 0s;\n' +
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_fastly_config_methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ tap.test('testSetTTL', function (t) {
'if (itsactuallyttyl) {\n' +
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionsid) {\n' +
' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' +
' unset beresp.http.set-cookie;\n' +
' return(deliver);\n' +
' } else {\n' +
' set beresp.ttl = 0s;\n' +
' set beresp.grace = 0s;\n' +
Expand Down

0 comments on commit c65b0ef

Please sign in to comment.