Skip to content
Snippets Groups Projects
Commit 7b079ff7 authored by stuebinm's avatar stuebinm
Browse files

reject map urls starting with /_/

parent 3a3cb19e
Branches
No related tags found
No related merge requests found
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
...@@ -176,9 +177,11 @@ checkLayerProperty p@(Property name _value) = case name of ...@@ -176,9 +177,11 @@ checkLayerProperty p@(Property name _value) = case name of
"allowApi" -> isForbidden "allowApi" -> isForbidden
"exitUrl" -> do "exitUrl" -> do
forbidEmptyLayer forbidEmptyLayer
unwrapLink p $ \link -> if "/" `isPrefixOf` link unwrapLink p $ \link -> if
then dependsOn $ MapLink link | "/_/" `isPrefixOf` link ->
else unwrapPath link (dependsOn . LocalMap) complain "absolute map links (i.e. links starting with '/_/') are disallowed."
| "/@/" `isPrefixOf` link -> dependsOn $ MapLink link -- TODO
| otherwise -> unwrapPath link (dependsOn . LocalMap)
"startLayer" -> do "startLayer" -> do
forbidEmptyLayer forbidEmptyLayer
layer <- askContext layer <- askContext
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment