mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00
Don't redirect dynamic CSS from https to http
This can break things (d'uh). Do this by introducing a new decorator, @ssl_optional. When this is present, no SSL redirection will happen, regardless of whether the access comes in over http or https. This decorator overrides @ssl_required, but for redability's sake, never use both at the same time.
This commit is contained in:
@ -14,7 +14,7 @@ import os
|
||||
import re
|
||||
import urllib
|
||||
|
||||
from pgweb.util.decorators import ssl_required, cache, nocache
|
||||
from pgweb.util.decorators import ssl_required, ssl_optional, cache, nocache
|
||||
from pgweb.util.contexts import NavContext
|
||||
from pgweb.util.helpers import simple_form, PgXmlHelper, HttpServerError
|
||||
from pgweb.util.moderation import get_all_pending_moderations
|
||||
@ -174,6 +174,7 @@ _dynamic_cssmap = {
|
||||
'../media/css/docs.css'],
|
||||
}
|
||||
@cache(hours=6)
|
||||
@ssl_optional
|
||||
def dynamic_css(request, css):
|
||||
if not _dynamic_cssmap.has_key(css):
|
||||
raise Http404('CSS not found')
|
||||
|
Reference in New Issue
Block a user