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

Exception Thrown: System.ArgumentNullException when Running the WebSocketExample #2

Open
joshglenn opened this issue Apr 21, 2020 · 1 comment

Comments

@joshglenn
Copy link

Hi! I was just checking out your WebSocketExample repo. Looks like a great job!

When trying to run the WebSocketExample project, this line triggers a System.ArgumentNullException exception:

if (context.Request.AcceptTypes.Contains("text/html"))

At that point context.request.AcceptTypes is null

Here is the locals window at that point in time:

Screen Shot 2020-04-21 at 11 06 06 AM

@MV10
Copy link
Owner

MV10 commented Jun 29, 2020

Sorry I took so long to reply, I've been heavily tied up on some other projects.

I'm surprised Accept is missing, that's about as basic and standard as headers get in HTTP! Technically there are probably other possible problems in that super-simplified code, for example */* is a common Accept header value, too.

Can you tell me more about the scenario you're testing? I see AppleWebKit in the UserAgent, are you running this on a Mac with Safari maybe? I'm not really set up to test with that, but I just pulled down the code and updated the Kestrel project and the newer console project to .NET 3.1. When I wrote the article I was using Chrome on Win10, and now I've switched to Firefox. Both a browser client and the console project are still working normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants