-
Notifications
You must be signed in to change notification settings - Fork 156
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
responseXML access error #89
Comments
Hi, Thanks for reporting this, is there a sample request you can share so I can test it? |
Hi, I have something like this:
should I not set the |
Generally it's not something you do but rather define these things via
headers.
Either way I'll have a look if this type of request is compliant with the
spec and if it is I'll work on supporting it.
…On Mon, Jun 4, 2018, 23:58 Patrik J. Braun ***@***.***> wrote:
Hi,
I have something like this:
const url = '...';
const request:= {
url: 'https://raw.githubusercontent.com/bpatrik/PiGallery2/master/README.md',
method: 'GET',
timeout: 0,
headers: {},
type: 'text',
withCredentials: false
};
const xhr = new XMLHttpRequest();
xhr.open('GET', url + '/api/http-request?data=' + encodeURIComponent(JSON.stringify(req)), true);
if (request.type) {
xhr.responseType = request.type;
}
xhr.send();
should I not set the type explicitly to text ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#89 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABlqIoZjZSFguScCVDWV1FSCMAAFM7I_ks5t5Z95gaJpZM4UZnSI>
.
|
morsdyce
added a commit
that referenced
this issue
Jun 11, 2018
When trying to use the XHR api set with a content type of 'text' the browser throws an error it is unable to read responseXML as the response isn't valid xml and the response type is not an empty string or 'document' as according to spec. this change was implemented due to inconsistent implementation across browsers and 3rd party network libraries which do parse xml responses even when the response type is not set according to the spec. In order to support all clients we now try to assign the responseXML property when possible but fail silently when we cannot. This will keep both behaviors consistent as incorrectly implemented clients will be able to read the XML response while still supporting the correctly implemented clients to not fail the request when trying to access responseXML on an invalid request. please see issues #86 #89 for more information.
Fixed in v1.4.9 Please check it out and let me know if it works for you. Thanks |
Seems to be working. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I got the following error in the latest version (
1.4.8
) in chrome66.0.3359.181
As far as I could debug, the error seems to be in the
readBody
function atxhook.js:336
Might be related to #86
Any suggestions?
Thank you!
Patrik
The text was updated successfully, but these errors were encountered: