Skip to content

Commit

Permalink
Escape single quotes in key/val strings
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceisla committed Jun 30, 2023
1 parent dec81f1 commit 98f626b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PostgREST/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,6 @@ addFallbackAppName version dbUri = dbUri <>
_ -> "&" <> uriFmt
where
uriFmt = toS $ escapeURIString isUnescapedInURI $ toS (pKeyWord <> pgrstVer)
keyValFmt = pKeyWord <> "'" <> pgrstVer <> "'"
keyValFmt = pKeyWord <> "'" <> T.replace "'" "\\'" pgrstVer <> "'"
pKeyWord = "fallback_application_name="
pgrstVer = "PostgREST " <> T.decodeUtf8 version

0 comments on commit 98f626b

Please sign in to comment.