Unverified Commit cd27b68c authored by Colby Gutierrez-Kraybill's avatar Colby Gutierrez-Kraybill Committed by GitHub

Merge pull request #1720 from LLK/hotfix/cache-nav-session-endpoints

[Develop] Hotfix/cache nav session endpoints
parents 7432c20f 0ba2693c
...@@ -67,7 +67,8 @@ async.auto({ ...@@ -67,7 +67,8 @@ async.auto({
'std.tolower(req.http.Accept-Language)' + 'std.tolower(req.http.Accept-Language)' +
');\n' + ');\n' +
' }\n' + ' }\n' +
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionsid) {\n' + ' if (req.url ~ "^(/projects/|/fragment/account-nav.json|/session/)" && ' +
'!req.http.Cookie:scratchsessionsid) {\n' +
' set req.http.Cookie = "scratchlanguage=" req.http.Cookie:scratchlanguage;\n' + ' set req.http.Cookie = "scratchlanguage=" req.http.Cookie:scratchlanguage;\n' +
' } else {\n' + ' } else {\n' +
' return(pass);\n' + ' return(pass);\n' +
......
...@@ -93,7 +93,8 @@ var FastlyConfigMethods = { ...@@ -93,7 +93,8 @@ var FastlyConfigMethods = {
setResponseTTL: function (condition) { setResponseTTL: function (condition) {
return '' + return '' +
'if (' + condition + ') {\n' + 'if (' + condition + ') {\n' +
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionsid) {\n' + ' if (req.url ~ "^(/projects/|/fragment/account-nav.json|/session/)" && ' +
'!req.http.Cookie:scratchsessionsid) {\n' +
' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' + ' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' +
' unset beresp.http.set-cookie;\n' + ' unset beresp.http.set-cookie;\n' +
' return(deliver);\n' + ' return(deliver);\n' +
......
...@@ -63,7 +63,8 @@ tap.test('testSetTTL', function (t) { ...@@ -63,7 +63,8 @@ tap.test('testSetTTL', function (t) {
var ttl = fastlyConfig.setResponseTTL('itsactuallyttyl'); var ttl = fastlyConfig.setResponseTTL('itsactuallyttyl');
t.equal(ttl, '' + t.equal(ttl, '' +
'if (itsactuallyttyl) {\n' + 'if (itsactuallyttyl) {\n' +
' if (req.url ~ "^/projects/" && !req.http.Cookie:scratchsessionsid) {\n' + ' if (req.url ~ "^(/projects/|/fragment/account-nav.json|/session/)" && ' +
'!req.http.Cookie:scratchsessionsid) {\n' +
' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' + ' set beresp.http.Vary = "Accept-Encoding, Accept-Language";\n' +
' unset beresp.http.set-cookie;\n' + ' unset beresp.http.set-cookie;\n' +
' return(deliver);\n' + ' return(deliver);\n' +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment