hurl icon indicating copy to clipboard operation
hurl copied to clipboard

How to know if there has been a redirection or not ?

Open ecolinet opened this issue 3 years ago • 3 comments

Hi, When I use :

[Options]
location: true

I want to know if a redirection has occured or not.

Is it possible to have a redirection counter ?

In my case url is not enought because the redirection bring me back the the original url and asserting for a 200 status code doesn't say if there has been a redirection or not.

Thanks

ecolinet avatar Oct 24 '22 09:10 ecolinet

Thanks for your suggestion. we could add a query redirections to get all the redirections that had occured, and then use our count filter.

Something like that.

[Asserts]
redirections count > 0

fabricereix avatar Oct 24 '22 10:10 fabricereix

Sounds good thanks

Le lun. 24 oct. 2022 à 12:02, Fabrice Reix @.***> a écrit :

Thanks for your suggestion. we could add a query redirections to get all the redirections that had occured, and then use our count filter.

Something like that.

[Asserts] redirections count > 0

— Reply to this email directly, view it on GitHub https://github.com/Orange-OpenSource/hurl/issues/922#issuecomment-1288769261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAP7YTP6KOCKFDA2DV2RTLWEZNFFANCNFSM6AAAAAARMZEAT4 . You are receiving this because you authored the thread.Message ID: @.***>

ecolinet avatar Oct 25 '22 07:10 ecolinet

As we speak of "HTTP redirects", I will prefer redirects as noun of the query:

[Asserts]
redirects count > 0

Extract from https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections

HTTP has a special kind of response, called a HTTP redirect, for this operation.

jcamiel avatar Nov 08 '22 22:11 jcamiel