JetClient / jet-client-support

JetClient is an advanced REST API Client plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/21173-jetclient
111 stars 0 forks source link

When adding a JWT token a space is inserted in the beginning #6

Closed rickythefox closed 1 year ago

rickythefox commented 1 year ago

Describe the Issue

When adding a JWT token a space is inserted in the beginning of the token.

Steps to reproduce?

1. Create a request with a JWT token in Auth tab (select Token).
2. Paste JWT
3. Send request

Checking the token on the server shows that a space was added in the beginning. .strip() on the server removes the space and makes it work.

Operating System

MacOS

IDE

Pycharm 2022.3.3 Pro

JetClient version

2023.1.4-223

Relevant log output

No response

Screenshots, Videos, Additional Context

No response

AntonShuvaev commented 1 year ago

I cannot reproduce this bug. I've tested by sending a request with token test to https://httpbin.org/anything and got "Authorization": "Bearer test" in the response. See the screenshot: Untitled

Can you please do the same test and double check that you are using the correct token?

rickythefox commented 1 year ago

You're right, it was copy/paste issue.

However it might make sense to trim the whitespace on the entered token before sending it? I'm not sure if a JWT starting or ending with a space is valid standard-wise.

Anyway, not a bug.