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

A suggestion #32

Open
EloB opened this issue Jul 16, 2020 · 3 comments
Open

A suggestion #32

EloB opened this issue Jul 16, 2020 · 3 comments
Labels
question Further information is requested

Comments

@EloB
Copy link

EloB commented Jul 16, 2020

Hello mate!

I saw this line:

const baseUrl = response.url.substring(0, response.url.lastIndexOf('/'));

Isn't better to use URL? I'm having a problem that it adds pathname twice after each other that fails my request. Like /my/pathname/mypathname instead of /my/pathname. I'm not sure this is the right way to do it or if it's a different puzzle...

const { URL } = require('url');

const { origin: baseUrl } = new URL(response.url);

Best regards!

@EloB
Copy link
Author

EloB commented Jul 16, 2020

I also want to say you made an awesome library ❤️

@sayem314 sayem314 added the question Further information is requested label Aug 8, 2020
@sayem314
Copy link
Owner

sayem314 commented Aug 8, 2020

Can you provide an example URL you are having issue with?

@msjonker
Copy link

msjonker commented Jan 5, 2021

I have a PR for this, with an example URL: #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants