`normalizePathSegments` replaces the password in the userinfo with `...`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read the normalizePathSegments implementation and its normstr branch, where the issue identifies show (normuri u) as the source of the password change. Check nearby tests for URI normalization and add coverage for userinfo containing a password, including paths with and without dot segments. Done means normalization preserves the original password while still removing dot segments; run the relevant tests with the reported network-uri and GHC versions if available.
Written by the indexing model from the issue text.
Description
normalizePathSegments changes the userinfo of a URI that contains a password:
>>> normalizePathSegments "http://user:[email protected]/a/../b"
"http://user:[email protected]/b"
>>> normalizePathSegments "http://user:[email protected]/b"
"http://user:[email protected]/b"
I expected "http://user:[email protected]/b" in both cases. The result is still a valid URI, now with the password
..., so nothing signals the change. normalizeCase and normalizeEscape keep the userinfo.
The function parses the string, removes the dot segments and renders the result with show:
normstr (Just u) = show (normuri u)
and the Show URI instance hides the password on purpose (uriToString defaultUserInfoMap). Using
uriToString id fixes it:
- normstr (Just u) = show (normuri u)
+ normstr (Just u) = uriToString id (normuri u) ""
Tested with network-uri 2.6.4.2 and current master, GHC 9.6.7.
- Dominant language
- Haskell
- Stars
- 28
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/network-uri
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
haskell/network-uri#94 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
haskell/network-uri#92 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
haskell/network-uri#90 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
haskell/network-uri#91 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
haskell/network-uri#81 · 2 comments ·
All issues in haskell/network-uri
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-ledger#6276 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenZeppelin/canton-contracts#92 ·
Maintainers usually reply within 1 day