sayem314 / hooman

http interceptor to hoomanize cloudflare requests
https://www.npmjs.com/package/hooman
MIT License
146 stars 18 forks source link

A suggestion #32

Open EloB opened 4 years ago

EloB commented 4 years ago

Hello mate!

I saw this line: https://github.com/sayem314/hooman/blob/11d0a1378cad339e71376f99ef6a854f775d404e/lib/captcha.js#L38

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 commented 4 years ago

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

sayem314 commented 4 years ago

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

msjonker commented 3 years ago

I have a PR for this, with an example URL: https://github.com/sayem314/hooman/pull/25