diff --git a/README.md b/README.md index 45e828d..2f3d165 100644 --- a/README.md +++ b/README.md @@ -485,15 +485,15 @@ This means that you can mix url-encoded text, half encoded text or unencoded tex Example: ``` [Host] -https://localhost:8080/api/finance/ca$h +https://localhost:8080/download/file/dir with%20spaces # %20= [Query] -account=full of ca%24h # This is already url-encoded (%24 = $) +filename=filename with %24$ in it # %24=$ ``` Will result in the URL: ``` -https://localhost:8080/api/finance/ca%24h?account=full+of+ca%24h +https://localhost:8080/download/file/dir%20with%20spaces?filename=filename+with+%24%24+in+it ``` The only caveats is that ain cannot know if a plus sign (+) is an encoded space or an literal plus sign. In this case ain assumes a space and leave the plus sign as is. diff --git a/test/e2e/templates/ok-url-encoding-host-and-qps.ain b/test/e2e/templates/ok-url-encoding-host-and-qps.ain new file mode 100644 index 0000000..84148fe --- /dev/null +++ b/test/e2e/templates/ok-url-encoding-host-and-qps.ain @@ -0,0 +1,13 @@ +[Host] +https://localhost:8080/download/file/dir with%20spaces # %20= + +[Query] +filename=filename with %24$ in it # %24=$ + +[Backend] +curl + +# args: +# - -p +# stdout: | +# curl 'https://localhost:8080/download/file/dir%20with%20spaces?filename=filename+with+%24%24+in+it'