#272 Add option to redirect HTTP to HTTPS
Closed by lholecek. Opened by lholecek.
lholecek/greenwave redirect-http-to-https  into  master

Download 272.patch
no initial comment

rebased onto 3ea10d6eb76c30f8220cb472cf9460179de0816c

it looks ok. But isn't it just easier to configure it in Openshift?

it looks ok. But isn't it just easier to configure it in Openshift?

Any idea how to do it there? Probably some gunicorn config?

@lholecek this is how I do it in OpenShift:
https://imgur.com/a/HEYs6U7

Oh, so OpenShift itself can do it. Nice. I'm dropping this and will try to set it in the YAML configs. Thanks for the info Matt.

Pull-Request has been closed by lholecek

Wait, redirection is already working for Greenwave prod. I saw "method not allowed" errors somewhere few days ago - not sure for which instance or app. :/

Method Not Allowed refers to the HTTP method (GET, POST, etc) which is unrelated to whether the connection is encrypted or not.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6

Just quick note about the "405 Method Not Allowed": Tools (like curl or httpie) handle redirection (some 3xx HTTP status codes) differently. E.g. doing GET instead of POST after redirection or throwing away POST data.

http --verbose --follow POST http://$GREENWAVE_SERVER/api/v1.0/decision
curl -Lv -X POST http://$GREENWAVE_SERVER/api/v1.0/decision --data '{"X"}'

@lholecek, yep I hit this too in the past.

What I've learnt then, is that POST requests are not idempotent (they change something on the server), so when redirection happens clients tend to stay on the safe side, as they cannot be sure if it's ok to resubmit the same data, or if it's ok to submit the data to the location they get redirected to.

This is really an old topic. Is it possible to explicitly use an HTTP 307
response?

On Tue, Aug 14, 2018, 9:05 PM Hunor Csomort=C3=A1ni pagure@pagure.io wrot=
e:

csomh commented on the pull-request: Add option to redirect HTTP to HTTPS that you are following:
``
@lholacek, yep I hit this too in the past.

What I've learnt then, is that POST requests are not idempotent (they
change something on the server), so when redirection happens clients tend
to stay on the safe side, as they cannot be sure if it's ok to resubmit t=
he
same data, or if it's ok to submit the data to the location they get
redirected to.
``

To reply, visit the link below or just reply to this email
https://pagure.io/greenwave/pull-request/272

HTTP 307 is 'Temporary Redirect'. Which doesn't really match with
'always redirect http to https'. At least it could be very misleading.

This is also an HTTP 308 status code, although I'm not sure the compatibility of that

Metadata