@@ 264,6 264,8 @@ packQuery q "multipart/form-data" = HTTP.formDataBody $ Prelude.map encodePart q
body <- B.readFile value
return $ HTTP.RequestBodyBuilder size $ Builder.lazyByteString body
packQuery _ _ = return -- Do not upload data if requested to do so in an invalid format.
+submitURL' session mimes uri method "GET" query = fetchURL' session mimes uri {
+ uriQuery = '?': encodeQuery query } -- Specialcase GET!
submitURL' session accept uri method encoding query | uriScheme uri `elem` ["http:", "https:"] = do
-- HURL is very strict on when it allows cookies to be set: Only POST HTTP requests are considered consent.
-- For the sake of most webframeworks' CSRF protection, cookies from retrieving the form are retroactively set.
@@ 276,7 278,7 @@ submitURL' session accept uri method encoding query | uriScheme uri `elem` ["htt
return ret {
HTTP.cookieJar = firstJust csrfCookies $ HTTP.cookieJar req,
HTTP.method = method
- }) $ \resp -> if method /= "POST" then return () else do
+ }) $ \resp -> do
let cookies = HTTP.responseCookieJar resp
swapMVar (globalCookieJar session) cookies
writeCookies (cookiesPath session) cookies False