Open gabriele-ricci-kyklos opened 3 years ago
Hello @gabriele-ricci-kyklos, thanks for the heads-up.
So, my beloved HttpListener strikes again. 🙈 Looks like the WWW-Authenticate
header cannot simply be set on a WebHeaderCollection
if it was created for use by HttpListenerResponse
: we should use the AddHeader
method instead to bypass some restrictions Microsoft chose to put in place to make our lives a bit less boring.
Unfortunately, EmbedIO's IHttpResponse
interface has no AddHeader
method. Adding it wouldn't be a breaking change, but still feels redundant and too "HttpListener-y" to me.
A nice solution would be a façade for WebHeaderCollection
that always calls SetInternal
instead of Set
; obviously it would have to retrieve the SetInternal
method via reflection. Hackish, ugly as hell, but it would do the job.
I won't be able to work on it for a couple weeks, so if someone comes up with a better idea, please comment below.
Hi @rdeago. thanks for the update. I can still make it work by using the EmbedIO HTTP Listener, so I'm not stuck. Later I will take a look at the library code, perhaps I can help with this issue. Many thanks
Describe the bug An exception occurs when using the
BasicAuthenticationModule
with a Microsoft HTTP listener.To Reproduce Steps to reproduce the behavior: Given this configuration
and the controller
Doing a call with the correct basic auth header results in a 500 error
Request:
Response:
The swan logger says
Expected behavior HTTP status code 200 and correct call response (
true
in this case)Important note: everything is working with the EmbedIO HTTP Listener