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

Issue when using both path and query options #86

Closed
julien-f opened this issue Jul 21, 2015 · 5 comments
Closed

Issue when using both path and query options #86

julien-f opened this issue Jul 21, 2015 · 5 comments
Milestone

Comments

@julien-f
Copy link
Contributor

Current implementation works if using pathname but not with path.

I think the URL object should be normalized as soon as possible to avoid conflicts between:

  • host and hostname
  • path and pathname
@floatdrop
Copy link
Contributor

I thought this would do for path and pathname https://github.com/sindresorhus/got/blob/master/index.js#L50-L52

    if (opts.pathname) {
        opts.path = opts.pathname;
    }

@julien-f
Copy link
Contributor Author

Yes but the issue is there https://github.com/sindresorhus/got/blob/master/index.js#L59

@julien-f
Copy link
Contributor Author

I should probably not use both path and query but this is not explicit in the doc and it worked in 3.2.

@floatdrop
Copy link
Contributor

@julien-f I'm really thinking about standalone module for parsing and normalization.

@floatdrop floatdrop mentioned this issue Jul 23, 2015
@floatdrop
Copy link
Contributor

This could be resolved, if we drop pathname support in options (since it not used in [http.request](https://nodejs.org/api/http.html#http_http_request_options_callback and in docs we claim that only request options are supported) and will not use url.format to create message (to avoid #72 regression).

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

2 participants