azerty
azerty

Reputation: 777

Follow only internal redirection

Is is possible to set an HttpClient to follow redirection only if this is a redirection on the same domain ?

I guess we could do that by checking somehow the redirected url and manually check if it is in the same domain (not sure if we can actually do that). Or maybe there is an option I did not find to do that automatically ?

Upvotes: 1

Views: 410

Answers (1)

Alexei Levenkov
Alexei Levenkov

Reputation: 100527

No, there is no option to follow just some redirects. You need to disable automatic "follow redirect" and handle 301/302 responses yourself by checking "location" header on the response.

See

Upvotes: 3

Related Questions