replaced '/' in query params
This commit is contained in:
parent
123cf76b3b
commit
2d9b07b9ba
@ -42,7 +42,7 @@ genUnencryptedCode client url expiration state = do
|
|||||||
now <- getCurrentTime
|
now <- getCurrentTime
|
||||||
let
|
let
|
||||||
expiresAt = expiration `addUTCTime` now
|
expiresAt = expiration `addUTCTime` now
|
||||||
simpleCode = replace "=" "%3D" . encodeBase64 . pack . filter (/= ' ') $ client <> url <> show now <> show expiresAt
|
simpleCode = replace "/" "%2F" . replace "=" "%3D" . encodeBase64 . pack . filter (/= ' ') $ client <> url <> show now <> show expiresAt
|
||||||
success <- atomically . stateTVar state $ \s ->
|
success <- atomically . stateTVar state $ \s ->
|
||||||
let mEntry = M.lookup simpleCode s.activeCodes
|
let mEntry = M.lookup simpleCode s.activeCodes
|
||||||
in
|
in
|
||||||
|
|||||||
@ -135,7 +135,7 @@ authServer = handleAuth
|
|||||||
addParams url (Just code) mState =
|
addParams url (Just code) mState =
|
||||||
let qPos = fromMaybe (length url) $ elemIndex '?' url
|
let qPos = fromMaybe (length url) $ elemIndex '?' url
|
||||||
(pre, post) = splitAt qPos url
|
(pre, post) = splitAt qPos url
|
||||||
rState = case mState of {Just s -> "&state=" ++ (unpack $ replace "=" "%3D" s); Nothing -> ""}
|
rState = case mState of {Just s -> "&state=" ++ (unpack . replace "/" "%2F" $ replace "=" "%3D" s); Nothing -> ""}
|
||||||
post' = if not (null post) then '&' : tail post else post
|
post' = if not (null post) then '&' : tail post else post
|
||||||
in Just . fromString $ pre ++ "?code=" ++ (unpack code) ++ post' ++ rState
|
in Just . fromString $ pre ++ "?code=" ++ (unpack code) ++ post' ++ rState
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user