-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Hub calls should fail if request's response is 3xx redirect #2106
Comments
We'll fix this for 2.0 |
I feel that a better approach would be to fail IF we are unable to parse the response body. This alternative is more of a general fail condition where if we're redirected to a page that is not valid JSON we can fail appropriately. |
…hen an error occurs, instead of throwing to the window object we now handle it appropriately. #2106
…rifying parse responses is handled correctly when it throws. #2106
… error handler and stop the connection. #2106
…hen an error occurs, instead of throwing to the window object we now handle it appropriately. #2106
…rifying parse responses is handled correctly when it throws. #2106
… error handler and stop the connection. #2106
Whatever was changed between 1.1.2 and 2.0.0 beta has caused some of the service resources like /xxxhub/signalr/connect to trigger forms authentication (without consulting the authorizeattribute on the hub -- which seems wrong to me). I'm not sure what it was, and I think it would be better if this was handled with a 401 and not a 302. One reason is that it seems to break IE9. Right now, IE is propagating the 302 to the entire page and redirecting me away from the page I'm trying to view. |
Moving this back into the working state, we need to special case requests that occur while in the connecting state to ensure if a redirect or some other parse error occurs during that time period that we fall back and not error->stop. |
- If transports fail to parse a response while in connecting they will now fall back. - Centralized this logic in the common.js #2106
…hile connecting indeed do fall back. #2106
- If transports fail to parse a response while in connecting they will now fall back. - Centralized this logic in the common.js #2106
…hile connecting indeed do fall back. #2106
@kbirger the latest change should fix your issue. As for the IE9 redirection I wasn't able to reproduce that issue. |
Verified OnError event is raised when request is redirected and the response content is not valid json LP-Connect |
@gustavo-armenta did you test any auth scenarios? |
@davidfowl
We are sending a response with 401, and the user is asked to input credentials again
|
Very nice. Can you try forms auth as well? |
I tried forms auth: |
The client library should treat requests with responses with redirect codes (e.g. 302/301) as failed.
This is problematic in situations where browser sessions expire but the client library is still trying to call back -- e.g. via timer
The observed behavior is that the request is made to the server, the server responds 302, the browser then does the redirect and requests the login page, but neither done() or fail() are called.
The text was updated successfully, but these errors were encountered: