Skip to content

Commit 595d05b

Browse files
authored
Don't URL encode path components (#2505)
Fixes #2467 After dhall-lang/dhall-lang#581 the standard requires implementations to not do anything special with respect to URL encoding. In other words, a conforming implementation: - Should not URL-encode path components when parsing imports from Dhall source code - Should not URL-encode path components when resolving those same imports The user can still specify an import that uses URL encoded path components, but the implementation does not give them any special treatment. It just blindly forwards those path components undisturbed. Before this change, the Haskell implementation of Dhall was correctly handling the first part (not url encoding path components at parse time) but was still incorrectly handling the second part (because it would URL encode path components at import resolution time). This change fixes that.
1 parent 7450d1f commit 595d05b

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

dhall/dhall.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ Common common
253253
transformers >= 0.5.2.0 && < 0.7 ,
254254
unix-compat >= 0.4.2 && < 0.7 ,
255255
unordered-containers >= 0.1.3.0 && < 0.3 ,
256-
uri-encode < 1.6 ,
257256
vector >= 0.11.0.0 && < 0.14
258257

259258
if flag(with-http)

dhall/src/Dhall/URL.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ import Data.Text (Text)
77

88
import Dhall.Syntax (Directory (..), File (..), Scheme (..), URL (..))
99

10-
import qualified Network.URI.Encode as URI.Encode
11-
1210
renderComponent :: Text -> Text
13-
renderComponent component = "/" <> URI.Encode.encodeText component
11+
renderComponent component = "/" <> component
1412

1513
renderQuery :: Text -> Text
1614
renderQuery query = "?" <> query

0 commit comments

Comments
 (0)