usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
28.13k stars 1.31k forks source link

bru.getAuthMode() return unexpected values when request has set "inherit" #2307

Open norman-knott opened 6 months ago

norman-knott commented 6 months ago

I have checked the following:

Describe the bug

I am trying to use the oauth2 mode in the collection, and to set the "Authentication" header only if the request is setup to use an authentication. Because I have also requests that should not add authentication information.

But bru.getAuthMode() returns unexpected values when executed in a request that has setup to inherit the authentication mode from the collection.

I attached an example collection, so you can reproduce it easier.

So far I got two different values bearer and none. bearer is returned by my original collection. I guess it is somehow because before I used bearer mode instead of oauth2. none is returned by the example collection I attached. But in both collections I set oauth2 for the collection and inherit for the request, as you can see in the attached screenshots. Also in the .bru files it set correctly.

I think it should return one of:

.bru file to reproduce the bug

getAuthMode_problem.zip

Screenshots/Live demo link

collection: image

image

request: image

image

norman-knott commented 6 months ago

Any idea about this problem?

norman-knott commented 5 months ago

ping