Form URL Encoded requests do not expand variables to their value
Similar to #148
Query:
Timeline output:
Hey @RInverid, are you still having the same issue? Also, could you let me know the version of Bruno you were using when the issue occurred?
Hi @sanjai0py , I can't reproduce this issue, but I'm sure I was on the latest version, I only just started using Bruno. Very odd, I will close this ticket and hopefully this issue will not return. thank you
Update: I managed to reproduce it, on version 1.13.1 (latest)! my secret variable has the character " in it, which causes this issue @sanjai0py .
bru file: repro.bru.txt
I'm seeing this bug on latest Bruno (v1.31, released yesterday). Hovering shows the value that should be interpolated, see screenshot.
I did some local debugging of this and found that the problem was that I used my own Content-Type header (set in the headers tab) and not relying on the one provided by Bruno.
In interpolate-vars.js the vars are only expanded properly if the header is an exact match of application/x-www-form-urlencoded.
In my case I had set the header to be application/x-www-form-urlencoded; charset=utf-8; which did not match.
Now that I know why it happened, it's no longer an issue for me. But I wonder if a more robust solution would be to match against the internal request.mode instead of the content type to allow for custom headers.
@sanjai0py
Although the main issue logged is resolved I was able to reproduce the scenario where interpolation breaks on content-type change. This happens for multipart form and form-url-encoded body