Failing tests when adding an Authorization header #10010
Replies: 1 comment
-
I was able to solve this. The issue seems to be the local HTTPS redirection. If anyone comes across this issue, I solved it by using the "https" client.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I started a small API which I'm writing integration (acceptance) tests for.
Everything worked fine until I added the [Authorize] attribute to the api controllers. This works fine from the SPA, from postman, basically everywhere except the tests with Aspire.
The only thing that I saw that could be related is that this assigns a random port when running and it's http not https and my guess is that the Authorization header is either not passed when it does the https redirection or something similar.
Btw, this works if I stop it in the debugger and hit the endpoint with Postman.
If anyone knows a solution on this, it'll be greatly appreciated.
I can post a minimal example if needed too.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions