It is sometimes required to set SECURE_SSL_REDIRECT to True in the settings (e.g. you can't force the redirection before the request reaches Django). When you do so however, the generated pages will be completely blank.
While there might be some discussions to have on how a HttpResponsePermanentRedirect should be handled, I reckon this is for another issue and that the right fix here is to set the request as secure. I'll open a PR shortly.
It is sometimes required to set
SECURE_SSL_REDIRECT
toTrue
in the settings (e.g. you can't force the redirection before the request reaches Django). When you do so however, the generated pages will be completely blank.This is because the request is not set as
secure
: https://github.com/moorinteractive/wagtail-bakery/blob/4c2979956a9601ffd25811314e90b31f713e60c6/src/wagtailbakery/views.py#L91-L92Which returns a
HttpResponsePermanentRedirect
which isn't handled (it reaches the 3rd if branch wherereponse.content
isb''
): https://github.com/moorinteractive/wagtail-bakery/blob/4c2979956a9601ffd25811314e90b31f713e60c6/src/wagtailbakery/views.py#L31-L40While there might be some discussions to have on how a
HttpResponsePermanentRedirect
should be handled, I reckon this is for another issue and that the right fix here is to set therequest
assecure
. I'll open a PR shortly.