apify / got-scraping

HTTP client made for scraping based on got.
526 stars 40 forks source link

Giving proxyUrl with a password that contains special characters crashes #55

Closed jirimoravcik closed 2 years ago

jirimoravcik commented 2 years ago

e.g. having proxyUrl = 'http://username:a6%6qgx12345@127.0.0.1:8888' will throw Uncaught URIError: URI malformed (see https://github.com/apify/got-scraping/blob/master/src/agent/h1-proxy-agent.ts#L21) I think it should work even with such passwords

ref https://github.com/sindresorhus/got/issues/1317

szmarczak commented 2 years ago

This is correct, %6q is malformed. You need to percent-encode % as %25:

http://username:a6%256qgx12345@127.0.0.1:8888