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

Infinite redirection with special characters in the redirected URL #2319

Closed
Cooya opened this issue Dec 18, 2023 · 1 comment
Closed

Infinite redirection with special characters in the redirected URL #2319

Cooya opened this issue Dec 18, 2023 · 1 comment

Comments

@Cooya
Copy link

Cooya commented Dec 18, 2023

When I try to request this specific URL :

import got from 'got';

const { data } = await got.get('https://www.adaptimmobilier.com/fr/detail.htm?cle=3476012640');

I get an infinite redirection error due to the presence of special characters in the redirected page (https://www.adaptimmobilier.com/fr/annonces/location/maison-et-terrain/va%EF%BF%BDrargues-34/offres-immobilieres-3476012640-p-r197-3476012640.html). But I am able to open the page with Firefox or Chrome, which means there is a decoding issue in Got.

@Cooya Cooya changed the title Infinite redirection with some special characters in the URL Infinite redirection with some special characters in the redirected URL Dec 18, 2023
@Cooya Cooya changed the title Infinite redirection with some special characters in the redirected URL Infinite redirection with special characters in the redirected URL Dec 18, 2023
@sindresorhus
Copy link
Owner

This is not a problem with Got. You cannot compare it to browsers, which are much more lenient since they are user-focused and interactive.

This fails on fetch too:

const { data } = await fetch('https://www.adaptimmobilier.com/fr/detail.htm?cle=3476012640');
TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///Users/sindresorhus/dev/oss/got/x.js:3:18 {
  cause: Error: redirect count exceeded

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
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