Stupid 302 redirect question. lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- jamie · 2019-06-29 16:19 So I am using some old Delphi (ICS) ThttpCli class for some basic web cam image fetching... I have a couple of test addresses that work in the browser but comes in the header as a 302 redirect and gives the new location to use.. The problem is that the location given is the same as the one I originally requested so if I were to update the URL property with the new location URL and do another HeadAsync it just comes back with the same thing so for now I just simply test the current URL with the Location url and if they are the same I then Abort the attempt.  The only thing I can come up with as an issue that it could be is the fact that the url is a HTTPS and looks like I need to have a SSL connection active, is this the case? ---------------------------------------------------------------------- lucamar · 2019-06-29 16:34 Difficult to say without the request and the reponse, but it's very probable. If your request asks for an http URI, it may possibly come back with a redirect to the same URI but with an https protocol. ---------------------------------------------------------------------- Remy Lebeau · 2019-07-03 03:38 Quote from: jamie on June 29, 2019, 06:19:47 pmThe problem is that the location given is the same as the one I originally requested Is it EXACTLY the same?  Slashes and query params and everything? I've seen cases where a URL redirects back to itself with a trailing slash included if one was missing in the original request. On the other hand, if the redirect URL is EXACTLY the same as the original URL, then the only time I've ever seen that happen is when the original request was missing a cookie that the URL requires, so it redirects back to itself with a new cookie included in the redirect response so it can be sent back in the next request. Quote from: jamie on June 29, 2019, 06:19:47 pmThe only thing I can come up with as an issue that it could be is the fact that the url is a HTTPS and looks like I need to have a SSL connection active, is this the case? Is the URL scheme/port number changing in the redirect?  Upgrading a request from HTTP to HTTPS is another common use of a redirect.  That would require dropping the current connection on the old port and reconnecting on the new port so an SSL/TLS handshake can then be performed.