Skip to content

Commit 835ec86

Browse files
committed
solga-client-ghcjs: allow users to set base url for request
1 parent 2a0b6fd commit 835ec86

File tree

1 file changed

+2
-1
lines changed
  • solga-client-ghcjs/src/Solga/Client

1 file changed

+2
-1
lines changed

solga-client-ghcjs/src/Solga/Client/GHCJS.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ type Header = (Text, Text)
8484
data Request = forall body. (DOM.IsXMLHttpRequestBody body) => Request
8585
{ reqMethod :: Text
8686
, reqSegments :: DList Text
87+
, reqBaseUrl :: Text
8788
, reqQuery :: DList (Text, Maybe Text)
8889
, reqUser :: Maybe Text
8990
, reqPassword :: Maybe Text
@@ -192,7 +193,7 @@ requestToUri :: Request -> DOM.JSM Text
192193
requestToUri Request{..} = do
193194
#if defined(ghcjs_HOST_OS)
194195
liftIO $ js_encodeURI $
195-
"/" <>
196+
reqBaseUrl <>
196197
T.intercalate "/" (DList.toList reqSegments) <>
197198
case DList.toList reqQuery of
198199
[] -> ""

0 commit comments

Comments
 (0)