on master help sign in
copying ByteString to prevent space leak (just in case).
commitd094042ac8ce4abe3de04c1b5b0ae4c40d4910de authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 28 Jun 2019, 13:04 (7 years ago) parent89635f7
1 file changed+4−2
wai-http2-extra/Network/Wai/Middleware/Push/Referer.hs+4−2
wai-http2-extra/Network/Wai/Middleware/Push/Referer.hs+4−2
@@ -120,10 +120,12 @@ pushOnReferer settings@Settings{..} app req sendResponse = do
120120 when (isNothing mauth
121121 || requestHeaderHost req == mauth) $ do
122122 when (path /= refPath) $ do -- just in case
123− mpp <- makePushPromise refPath path file
123+ let !path' = BS.copy path
124+ !refPath' = BS.copy refPath
125+ mpp <- makePushPromise refPath' path' file
124126 case mpp of
125127 Nothing -> return ()
126− Just pp -> reaperAdd reaper (refPath,pp)
128+ Just pp -> reaperAdd reaper (refPath',pp)
127129 ps -> do
128130 let !h2d = defaultHTTP2Data { http2dataPushPromise = ps}
129131 setHTTP2Data req (Just h2d)