You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, you may have noticed that the value of wctx is sort of half url encoded - it's actually JSON data, but the " have been escaped to be ".
Unfortunately, when I try to submit the form with the values:
POST {{action}}
[FormParams]
wa: {{wa_val}}
wresult: {{wresult_val}}
wctx: {{wctx_val}}
hurl uses urlEncode, which re-encodes the wctx values into: %7B%26%2334%3Bstrategy%26%2334%3B%3A%26%2334%3Bauth%26%2334%3B%2C%26%2334%3BauthClient%26%2334%3B%3A%26%2334%eyJjQifX0%26%2334%%3B%7D (not 100% that's actually valid, I had to modify it a bit).
Essentially: the ampersand codes that existed in the original form value data are themselves being encoded.
The re-encoding does not occur, but then the original ampersand codes are still there, and seem to mess things up.
The two solutions I can see are:
A filter to decode/encode HTML ampersand chars. Seems like a robust solution, but perhaps outside the scope of hurl?
A way to use regex to replace strings - e.g., if I do s/"/"/g on the original value string, it would be native JSON, which can then be properly encoded. This seems like a fairly brittle solution to my specific problem, but it would indeed work, and perhaps be more useful to the broader hurl community?
But I'd love to know if there are other (existing) solutions too!
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
Yes your two solutions are totally in the scope of Hurl and we want to address it. You've already seen that there are urlEncode and urlDecode filters. It makes totally sens to both have:
use html_escape;let t = "#&65 foo";println!("{}", html_escape::decode_html_entities(t));// #&65 foo
It's worth noting that all major browser support the lack of semi-colon so maybe, when we'll re-implement the escaping / unescaping (see #1093 ) we can add support for optional semi-colon.
Hello,
I've got perhaps a specific use-case, but hopefully it's something that
hurl
can do.So I've got a form like this:
Using a
Captures
block, I can get out the values:However, you may have noticed that the
value
ofwctx
is sort of half url encoded - it's actually JSON data, but the"
have been escaped to be"
.Unfortunately, when I try to submit the form with the values:
hurl
usesurlEncode
, which re-encodes thewctx
values into:%7B%26%2334%3Bstrategy%26%2334%3B%3A%26%2334%3Bauth%26%2334%3B%2C%26%2334%3BauthClient%26%2334%3B%3A%26%2334%eyJjQifX0%26%2334%%3B%7D
(not 100% that's actually valid, I had to modify it a bit).Essentially: the ampersand codes that existed in the original form value data are themselves being encoded.
If I use the 'raw' format, like
The re-encoding does not occur, but then the original ampersand codes are still there, and seem to mess things up.
The two solutions I can see are:
hurl
?s/"/"/g
on the original value string, it would be native JSON, which can then be properly encoded. This seems like a fairly brittle solution to my specific problem, but it would indeed work, and perhaps be more useful to the broaderhurl
community?But I'd love to know if there are other (existing) solutions too!
Thanks!
The text was updated successfully, but these errors were encountered: