Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually added Authorization header does funny things #2305

Open
2 tasks done
bbredewold opened this issue May 14, 2024 · 4 comments
Open
2 tasks done

Manually added Authorization header does funny things #2305

bbredewold opened this issue May 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@bbredewold
Copy link

bbredewold commented May 14, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

So, when adding an 'Authorization' header, I need to fill it with a custom value. So not a 'Bearer'-token' but an 'AfasToken'-token. As you can see in the screenshot, Bruno assumes a Bearer token anyway. This way I cannot use Bruno to make requests to AFAS.

I assume the Authorization header is overwritten from the Collection. But I expect that when I set the same header on the request itself, it should overwrite the one from the collection.

Screenshots/Live demo link

BRB2024-05-14 at 14 21 55@2x

@bbredewold bbredewold added the bug Something isn't working label May 14, 2024
@GarlicPunk
Copy link

You can try using a pre-request script to req.setHeader instead of using the form.

req.setHeader("transaction-id", nanoid());

@bbredewold
Copy link
Author

You can try using a pre-request script to req.setHeader instead of using the form.

req.setHeader("transaction-id", nanoid());

That seems to be a bit cumbersome for such a basic feature.
Imho request-set headers should always overwrite the Collection-set headers.

@pietrygamat
Copy link
Contributor

@bbredewold when that happens - what is the authorization mode used for your request? Is it inherit, None, or Bearer token? It looks to me that the problem is your request Auth overwriting your manually set header, but that should not happen when using auth mode = 'none' .

@lohxt1
Copy link
Collaborator

lohxt1 commented May 25, 2024

Imho request-set headers should always overwrite the Collection-set headers.

this is the current default behaviour

request_headers_over_collection_headers.mov

you can choose auth type as none, and set the AfasToken directly either through the header or via script

afastoken.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants