Skip to content

Commit b77497a

Browse files
Gabriella439locallycompact
authored andcommitted
Don't URL encode path components (dhall-lang#2505)
Fixes dhall-lang#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 b5c313b commit b77497a

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

dhall/dhall.cabal

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ Common common
254254
unix >= 2.7 && < 2.9 ,
255255
unix-compat >= 0.4.2 && < 0.7 ,
256256
unordered-containers >= 0.1.3.0 && < 0.3 ,
257-
uri-encode < 1.6 ,
258257
vector >= 0.11.0.0 && < 0.14
259258

260259
if flag(with-http)

dhall/src/Dhall/URL.hs

+1-3
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)