Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31465098
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
BBlack
Dec 10 2019, 2:22 PM
2019-12-10 14:22:54 (UTC+0)
Size
994 B
Referenced Files
None
Subscribers
None
raw.txt
View Options
function do_global_read_request()
- local cookie = ts.client_request.header['Cookie']
-
- if cookie then
- -- Equivalent to req.http.Cookie ~ "([sS]ession|Token)=" in VCL
- if string.match(cookie, '[sS]ession=') or string.find(cookie, 'Token=') then
- return pass()
- end
- end
-
if ts.client_request.header['Authorization'] then
return pass()
end
end
+function do_global_cache_lookup_complete
+ local cache_status = ts.http.get_cache_lookup_status()
+ if cache_status == TS_LUA_CACHE_LOOKUP_HIT_FRESH then -- XXX what about HIT_STALE?
+ local vary = ts.cached_response.header['Vary']:lower()
+ if vary and string.match(vary, 'cookie') then
+ local cookie = ts.client_request.header['Cookie']
+ if cookie and ( string.match(cookie, '[sS]ession=') or string.find(cookie, 'Token=') ) then
+ -- XXX don't use the object we just found
+ end
+ end
+ end
+end
+
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8261006
Default Alt Text
raw.txt (994 B)
Attached To
Mode
P9844 Cookie/Vary request side
Attached
Detach File
Event Timeline
Log In to Comment