Skip to content

XMLHttpRequest api has a wrong -was-aborted implementation #276

Open
@joana-sanchez-otm

Description

XHR's readyState when aborted is 4 (DONE), not 0 (UNSENT), and it returns an http status of 0 when it is aborted, so this does not work:

(-was-aborted [this] (= 0 (.-readyState this))))

In our code we are checking if the http status is 0 instead of checking for :failure :abort or using -was-aborted because of this.

Even if -was-aborted was fixed in the protocol implementation, I think it won't return :failure :aborted ,because it returns :failure :failed when the HTTP status is 0:

https://github.com/JulianBirch/cljs-ajax/blob/d551a46dbdeea7a5c9722fa008c78adda8ebcb1d/src/ajax/interceptors.cljc#L110:L113

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions