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

Different uri/url parsing behavior between request.js and urequest.js #13

Open
kaimoe opened this issue May 16, 2023 · 0 comments
Open

Comments

@kaimoe
Copy link

kaimoe commented May 16, 2023

I have a project that uses the request method from this package in this simple form:

request({
    uri: `${this.endpoint + path}`,
    json: true
})

When ran on node, this resolves just fine. When ran on a browser, such as a Vue component, it produces the following error:

TypeError: Response.text: Body has already been consumed.
    body                       urequest.js:168
    promise callback*request   urequest.js:167
    ...

I narrowed this down to different behavior between the server-side request.js file and the client-side urequest.js. While the former has a routine to ensure either url or uri work fine, the latter does not and seems to only try using the empty url key.

Is this difference at all intentional?

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