Skip to content

Commit 98f07bc

Browse files
committed
Check actual value in the caching header
1 parent 5abbe63 commit 98f07bc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Share.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ mkShareServer env = do
143143
appServer reqTagsKey req noCacheHeader (Cookies.cookieVal -> noCacheCookie) mayRequestID mayUserId =
144144
let reqMethod = Wai.requestMethod req
145145
addReqCtx m = do
146-
let useCaching = not Deployment.onLocal && Maybe.isNothing noCacheHeader && Maybe.isNothing noCacheCookie
146+
let isSet = \case
147+
Nothing -> False
148+
Just v
149+
| lower <- Text.toLower v, lower == "false" -> False
150+
| otherwise -> True
151+
let useCaching = not Deployment.onLocal && not (isSet noCacheHeader) && not (isSet noCacheCookie)
147152
let reqTags =
148153
Map.fromList
149154
[ ("caching-disabled", showBool $ not useCaching),

0 commit comments

Comments
 (0)