Skip to content
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

[Bug] The default value of XHR's response is incorrect #173

Open
condorheroblog opened this issue Jan 5, 2024 · 0 comments
Open

[Bug] The default value of XHR's response is incorrect #173

condorheroblog opened this issue Jan 5, 2024 · 0 comments

Comments

@condorheroblog
Copy link

In XHR's request, if I do not provide the response body - data, for example, in Node, using response. end() to end the request, the value of xhr.response will vary depending on the xhr.responseType. The actual comparison situation is shown in the table below.

xhr.responseType xhr.response
"" ""
text ""
json null
blob new Blob([], { type: "Content-Type" })(The value of Content-Type is returned by the server)
arraybuffer new ArrayBuffer()

But in xhook, the value of xhr. response is always an empty string.

condorheroblog added a commit to condorheroblog/vite-plugin-fake-server that referenced this issue Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant