Skip to content

Commit 30472ac

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

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module Solga.Client.GHCJS
3333
, WithData(..)
3434
, GetResponse(..)
3535
, Request(..)
36+
, RequestUriType(..)
3637
, Response(..)
3738
, Header
3839
, XHRError(..)
@@ -84,6 +85,7 @@ type Header = (Text, Text)
8485
data Request = forall body. (DOM.IsXMLHttpRequestBody body) => Request
8586
{ reqMethod :: Text
8687
, reqSegments :: DList Text
88+
, reqBaseUrl :: Text
8789
, reqQuery :: DList (Text, Maybe Text)
8890
, reqUser :: Maybe Text
8991
, reqPassword :: Maybe Text
@@ -192,7 +194,7 @@ requestToUri :: Request -> DOM.JSM Text
192194
requestToUri Request{..} = do
193195
#if defined(ghcjs_HOST_OS)
194196
liftIO $ js_encodeURI $
195-
"/" <>
197+
reqBaseUrl <>
196198
T.intercalate "/" (DList.toList reqSegments) <>
197199
case DList.toList reqQuery of
198200
[] -> ""

0 commit comments

Comments
 (0)