Skip to content

Commit

Permalink
Merge pull request #41 from castaway/reserved-pct-encoded
Browse files Browse the repository at this point in the history
Add some tests for passing already-pct-encoded values to a + or #var #40
  • Loading branch information
mnot authored Jan 18, 2022
2 parents 6b14609 + 5cd8c73 commit 6a00b8a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions extended-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,30 @@
"/user/admin?token=12345&tab=overview&key2=val2&key1=val1"]
]
]
},
"Additional Examples 6: Reserved Expansion":{
"variables" : {
"id" : "admin%2F",
"not_pct" : "%foo",
"list" : ["red%25", "%2Fgreen", "blue "],
"keys" : {
"key1": "val1%2F",
"key2": "val2%2F"
}
},
"testcases": [
["{+id}", "admin%2F"],
["{#id}", "#admin%2F"],
["{id}", "admin%252F"],
["{+not_pct}", "%25foo"],
["{#not_pct}", "#%25foo"],
["{not_pct}", "%25foo"],
["{+list}", "red%25,%2Fgreen,blue%20"],
["{#list}", "#red%25,%2Fgreen,blue%20"],
["{list}", "red%2525,%252Fgreen,blue%20"],
["{+keys}", "key1,val1%2F,key2,val2%2F"],
["{#keys}", "#key1,val1%2F,key2,val2%2F"],
["{keys}", "key1,val1%252F,key2,val2%252F"]
]
}
}

0 comments on commit 6a00b8a

Please sign in to comment.