HTTP Requests: variable parsing in quoted header values
I've a request like:
### Create
POST http://example.com:5000/api/v1/bulkcreate?rnd={{$timestamp}}
Content-Type: multipart/form-data; boundary=WebAppBoundary
Authorization: Bearer YOURTOKENHERE
Alvaro-Test: {{$timestamp}}
--WebAppBoundary
Content-Disposition: form-data; name="file"; filename="Create {{$timestamp}}.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
< /home/alvaro/Data/Create.xlsx
--WebAppBoundary--
The {{$timestamp}} variable is being properly parsed everywhere except in the Content-Disposition header. By trial and error, I discovered it's because it's inside a quoted string. This does work:
Content-Disposition: form-data; name="file"; filename=Create_{{$timestamp}}.xlsx
Is it the intended behaviour? Is there a syntax to have both spaces and variables in the filename attribute?
Please sign in to leave a comment.
It appears to be a bug. Thank you for reporting, I've pushed it to the HTTP Client issue tracker: https://youtrack.jetbrains.com/issue/IDEA-298120/Environment-variables-dont-work-in-double-quoted-elements-in-Content-Disposition