This repository has been archived by the owner. It is now read-only.

Improve redirect code #7

Closed
ollieparanoid opened this Issue Aug 22, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@ollieparanoid
Member

ollieparanoid commented Aug 22, 2017

@MartijnBraam said in the channel:

also noticed that the horrible redirect hack hasn't been replaced with an actual redirect yet

@MartijnBraam

This comment has been minimized.

Show comment
Hide comment
@MartijnBraam

MartijnBraam Aug 22, 2017

Member

The redirect.html can be replaced with returning an actual redirect object instead of a template, which makes it return a 3xx status code. Not sure about the specifics, it's been a while I've used flask

Member

MartijnBraam commented Aug 22, 2017

The redirect.html can be replaced with returning an actual redirect object instead of a template, which makes it return a 3xx status code. Not sure about the specifics, it's been a while I've used flask

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Aug 22, 2017

Member

Does this also work with the statically hosted website, which really needs something like a redirect.html page and can not return a 3xx?

Member

ollieparanoid commented Aug 22, 2017

Does this also work with the statically hosted website, which really needs something like a redirect.html page and can not return a 3xx?

@MartijnBraam

This comment has been minimized.

Show comment
Hide comment
@MartijnBraam

MartijnBraam Aug 22, 2017

Member

Hmm that would break, but we can respond with the redirect.html like now but with a 3xx status code and a location header, then it would work both ways. But with 3xx codes it would work if you just run varnish in front of the python application instead of creating static pages.

Member

MartijnBraam commented Aug 22, 2017

Hmm that would break, but we can respond with the redirect.html like now but with a 3xx status code and a location header, then it would work both ways. But with 3xx codes it would work if you just run varnish in front of the python application instead of creating static pages.

@yuvadm

This comment has been minimized.

Show comment
Hide comment
@yuvadm

yuvadm Aug 26, 2017

Member

I thought the main point was to keep the website statically hosted. Of course if we run it live we can do proper redirects.

Do we want to go through the extra trouble of setting up a live version of the website? Again, seems a bit premature, but if we can stash it on the same server as the wiki (perhaps?) and setup a proper deployment hook then it could work.

Member

yuvadm commented Aug 26, 2017

I thought the main point was to keep the website statically hosted. Of course if we run it live we can do proper redirects.

Do we want to go through the extra trouble of setting up a live version of the website? Again, seems a bit premature, but if we can stash it on the same server as the wiki (perhaps?) and setup a proper deployment hook then it could work.

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Aug 26, 2017

Member

I would prefer a statically hosted site, this is always better from a security perspective.
If I understood @MartijnBraam correctly, this would just be a nice to have for testing the site in the browser?

Member

ollieparanoid commented Aug 26, 2017

I would prefer a statically hosted site, this is always better from a security perspective.
If I understood @MartijnBraam correctly, this would just be a nice to have for testing the site in the browser?

@MartijnBraam

This comment has been minimized.

Show comment
Hide comment
@MartijnBraam

MartijnBraam Aug 26, 2017

Member

Well returning redirects is nice for development and maybe in the future when we might host it dynamically.

A nice solution would be if frozen-flask could generate .htaccess files (or equivelent for other servers) for the redirect responses it finds (instead of copying the response or ignoring it completely).
I have no idea if the current hosting supports proper redirects somehow.

Member

MartijnBraam commented Aug 26, 2017

Well returning redirects is nice for development and maybe in the future when we might host it dynamically.

A nice solution would be if frozen-flask could generate .htaccess files (or equivelent for other servers) for the redirect responses it finds (instead of copying the response or ignoring it completely).
I have no idea if the current hosting supports proper redirects somehow.

@ollieparanoid

This comment has been minimized.

Show comment
Hide comment
@ollieparanoid

ollieparanoid Oct 20, 2017

Member

@MartijnBraam: What we have now seems to work great and I don't see any benefit in replacing it with a dynamic page. Do you see it the same way and can this issue be closed?

Member

ollieparanoid commented Oct 20, 2017

@MartijnBraam: What we have now seems to work great and I don't see any benefit in replacing it with a dynamic page. Do you see it the same way and can this issue be closed?

@MartijnBraam

This comment has been minimized.

Show comment
Hide comment
@MartijnBraam

MartijnBraam Oct 20, 2017

Member

Yeah this can probably be closed, Maybe I create a patch for frozen-flask for this in the future because having it with a .htaccess would still be neater.

Member

MartijnBraam commented Oct 20, 2017

Yeah this can probably be closed, Maybe I create a patch for frozen-flask for this in the future because having it with a .htaccess would still be neater.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.