-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
X-Requested-With header is incorrect in FetchHttpClient #44933
Comments
This header is intentionally set so that Cookie authentication will avoid redirecting to a login page, if it actually did the redirect, it would result in an ugly, hard to diagnose error on the client side. aspnetcore/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs Lines 94 to 96 in 3ea008c
aspnetcore/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs Lines 105 to 108 in 3ea008c
This behavior is customizable by setting the header yourself when creating the connection.
|
What is the point of it if it's always set to "XMLHttpRequest", even when the FetchHttpClient is used? Shouldn't CookieAuthenticationEvents.cs be modified to also accept "Fetch"? |
Why do you need to know this information?
Is this customization not usable for your scenario?
No. Using "Fetch" as the header value is not a common pattern, whereas |
Hi @val1984. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. See our Issue Management Policies for more information. |
Is there an existing issue for this?
Describe the bug
FetchHttpClient.ts
setsX-Requested-With
header toXMLHttpRequest
which makes it harder than needed to know which HTTP client was used by@microsoft/signalr
JS library.Expected Behavior
X-Requested-With
header should be set toFetch
as it was in the initial implementation.Steps To Reproduce
Make use of
@microsoft/signalr
JS library and check the headers sent by the lib when calling the negotiate route.Exceptions (if any)
No response
.NET Version
No response
Anything else?
@microsoft/signalr
: ^6.0.9The text was updated successfully, but these errors were encountered: