You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exes/Main.hs
+28-4Lines changed: 28 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,8 @@ data RunFlags = RunFlags {
197
197
flagRunPort::FlagString,
198
198
flagRunIP::FlagString,
199
199
flagRunHostURI::FlagString,
200
+
flagRunUserContentURI::FlagString,
201
+
flagRunRequiredBaseHostHeader::FlagString,
200
202
flagRunStateDir::FlagFilePath,
201
203
flagRunStaticDir::FlagFilePath,
202
204
flagRunTmpDir::FlagFilePath,
@@ -215,6 +217,8 @@ defaultRunFlags = RunFlags {
215
217
flagRunPort =NoFlag,
216
218
flagRunIP =NoFlag,
217
219
flagRunHostURI =NoFlag,
220
+
flagRunUserContentURI =NoFlag,
221
+
flagRunRequiredBaseHostHeader =NoFlag,
218
222
flagRunStateDir =NoFlag,
219
223
flagRunStaticDir =NoFlag,
220
224
flagRunTmpDir =NoFlag,
@@ -264,6 +268,14 @@ runCommand =
264
268
"Server's public base URI (defaults to machine name)"
265
269
flagRunHostURI (\v flags -> flags { flagRunHostURI = v })
266
270
(reqArgFlag "NAME")
271
+
, option [] ["user-content-uri"]
272
+
"Server's public user content base URI (for untrusted content, defeating XSS style attacks)"
273
+
flagRunUserContentURI (\v flags -> flags { flagRunUserContentURI = v })
274
+
(reqArgFlag "NAME")
275
+
, option [] ["required-base-host-header"]
276
+
"Required host header value for incoming requests (potentially internal, e.g. if behind reverse proxy). Base means that it is _not_ for the user-content domain."
277
+
flagRunRequiredBaseHostHeader (\v flags -> flags { flagRunRequiredBaseHostHeader = v })
278
+
(reqArgFlag "NAME")
267
279
, optionStateDir
268
280
flagRunStateDir (\v flags -> flags { flagRunStateDir = v })
269
281
, optionStaticDir
@@ -307,6 +319,8 @@ runAction opts = do
307
319
port <- checkPortOpt defaults (flagToMaybe (flagRunPort opts))
308
320
ip <- checkIPOpt defaults (flagToMaybe (flagRunIP opts))
309
321
hosturi <- checkHostURI defaults (flagToMaybe (flagRunHostURI opts)) port
errForbidden "Bad Host" [MText$"Authenticated resources can only be accessed using the regular server host name "<> oughtToBeHost <>", but was provided host "<>show actualHost]
0 commit comments