Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$http incorrectly reports back 404 on canceled request #6074

Closed
@langdonx

Description

@langdonx

As of 1.2.8, canceled $http requests return a status of 404, instead of 0. It's a little tricky to reproduce on a public fiddle, but here's how:

Load the following full-screen fiddle and just keep trying to refresh the page before the page has fully loaded (F5, F5, F5, F5...). Eventually you'll see an alert that says "error callback 404":

http://jsfiddle.net/C4jRt/8/embedded/result/

In 1.2.7 and before, you'll get "error callback 0" as expected:

http://jsfiddle.net/C4jRt/7/embedded/result/

Chrome and Firefox give 404, so it's not browser specific. Firefox swallows the alert when you refresh, so you have to be quick to see it. I couldn't ever see the alert in IE, so.

I'm relying on this status code to handle and react to errors. My web server is a little slow, so I don't want to show a bunch of errors to the user when they refresh while they're waiting for it to come back.

v1.2.8 (incorrect)
http://jsfiddle.net/C4jRt/8

v1.2.7 (correct)
http://jsfiddle.net/C4jRt/7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions