thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.64k stars 132 forks source link

Header update via scripting not reflected in UI #1613

Closed aagranovExtend closed 1 month ago

aagranovExtend commented 2 months ago

Describe the bug The header UI only seems to update by manual input, not via scripting.

To Reproduce What I do is in the Pre Run script, read an access token fro the OAuth2 tab and write it into a header via

const accessToken = tc.request.auth.oauth2.accessToken tc.request.setHeader('x-access-token', accessToken)

the actual request going out is correct, but the Headers UI still shows the old value.

Expected behavior I'd expect the header value to be updated in the UI.

Platform:

Are you using the free version/paid version/trial: free version

rangav commented 2 months ago

@aagranovExtend The Authorization value is set at time of sending the request, which is after the pre-req script execution.

You can use the Header Name property for this use-case which is available from v2.25.7

Screenshot 2024-09-26 at 04 37 46
rangav commented 1 month ago

@aagranovExtend Are you still experiencing the issue, or has it been resolved?

rangav commented 1 month ago

Closing this issue, feel free to continue discussion if needed