Closed bagder closed 2 months ago
@bagder
This patch fixed --json
, but not -g {path}
:
$ ./trurl 'http://example.org/%18' -g '{path}'
trurl note: URL decode error, most likely because of rubbish in the input (path)
Correct, as I like to focus on one thing per issue but also that the "regular" output is different and might need other considerations. Should we really allow control codes to be output like this?
Correct, as I like to focus on one thing per issue
I mentioned it because this PR closed #262
Should we really allow control codes to be output like this?
I don't see why not, also note that this is only causing errors for non-query:
gets:
$ trurl -g '{fragment}' 'https://example.org/compiler#def%20main:%20%0a%09print%20"hello"'
trurl note: URL decode error, most likely because of rubbish in the input (fragment)
$ trurl -g '{query:code}' 'https://example.org/compiler?code=def%20main:%0a%09print%20"hello"'
def main:
print "hello"
Incidentally, unrelated, but I have noticed that -g {query:blah}
doesn't convert +
=>
$ trurl -g '{query:code}' 'https://example.org/compiler?code=def+main:%0a%09print+"hello"'
def+main:
print+"hello"
Incidentally, unrelated, but I have noticed that -g {query:blah} doesn't convert +=>
It does now! :grin:
For example when doing
Adapted and extended test cases to verify.
Fixes #262 Reported-by: Emanuele Torre