on master help sign in
Replace 301 with 302 for redirects
374aaacMichael Snoyman
wai-app-static/ChangeLog.md+6
@@ -1,3 +1,9 @@
1+# wai-app-static changelog
2+
3+## 3.1.7
4+
5+* Use 302 instead of 301 redirect, to avoid caching the presence of an index.html file
6+
1## 3.1.6.3
7## 3.1.6.3
2
8
3* The executable warp obeys `-h` option properly for host
9* The executable warp obeys `-h` option properly for host
wai-app-static/Network/Wai/Application/Static.hs+2−2
@@ -267,13 +267,13 @@ staticAppPieces ss rawPieces req sendResponse = liftIO $ do
267 Just hash -> replace "etag" (Just hash) (W.queryString req)
267 Just hash -> replace "etag" (Just hash) (W.queryString req)
268 Nothing -> remove "etag" (W.queryString req)
268 Nothing -> remove "etag" (W.queryString req)
269
269
270− sendResponse $ W.responseLBS H.status301
270+ sendResponse $ W.responseLBS H.status302
271 [ ("Content-Type", "text/plain")
271 [ ("Content-Type", "text/plain")
272 , ("Location", S8.append loc $ H.renderQuery True qString)
272 , ("Location", S8.append loc $ H.renderQuery True qString)
273 ] "Redirect"
273 ] "Redirect"
274
274
275 response (RawRedirect path) =
275 response (RawRedirect path) =
276− sendResponse $ W.responseLBS H.status301
276+ sendResponse $ W.responseLBS H.status302
277 [ ("Content-Type", "text/plain")
277 [ ("Content-Type", "text/plain")
278 , ("Location", path)
278 , ("Location", path)
279 ] "Redirect"
279 ] "Redirect"
wai-app-static/wai-app-static.cabal+1−1
@@ -1,5 +1,5 @@
1name: wai-app-static
1name: wai-app-static
2−version: 3.1.6.3
2+version: 3.1.7
3license: MIT
3license: MIT
4license-file: LICENSE
4license-file: LICENSE
5author: Michael Snoyman <michael@snoyman.com>
5author: Michael Snoyman <michael@snoyman.com>