HTTP and 301 redirect

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
Hi all,

I noticed 301 redirect is not supported for HTTP requests and that led me to the question: is it something that should be supported out of box or this is some functionality the end user has to implement themselves?

Thanks!

Cheers
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,135
So you do a httprequest on an adress which basically just does a redirect? What code do you get? 301?
Please excuse the stupid questions but I have not much experience with HTMLRequests as I never did this and wonder why you do it?
 

muruba

New member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Patreon Silver
Joined
Jul 5, 2017
Messages
230
Basically I was calling my extra sophisticated analytics backend from my super great game via HTTP. Last night I noticed that IOS complained about HTTP and said HTTPS is enforced now. So I installed certs on my server and made sure the switch from HTTP->HTTPS is there via 301 redirect. Then I noticed as GLFW targets stopped sending data and stopping at getting 301 redirect back (HTTP). No biggie for me - I turned off redirect on the server.

But then I remembered that Java's http client as well as CURL have 'follow redirect' switches that should basically support these redirects without human intervention.

So mainly wondering what is the expected default behaviour for the HTTP requests functionality regarding redirects: to seamlessly support redirects or give user the choice to support it or leave it to the user to parse the response and issue a new request?

Just noticed if you go to http://www.cerberus-x.com that results in redirect so basically if CX issues this request it will not get the "real" front page back but will stop after this response:

  1. Request URL:
    http://www.cerberus-x.com/community/
  2. Request Method:
    GET
  3. Status Code:
    301 Moved Permanently
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
334
Yeah, oh well, something that probably can be configured in curl. Will look at it.
 
Top Bottom