When UiPassword is enabled, some files, fonts are sent with Content-Type: text/html; charset=utf-8, getContentType doesn't get called on them. Also Access-Control-Allow-Origin header is missing.
Steps to reproduce:
Open site http://127.0.0.1:43110/14c5LUN73J7KKMznp9LvZWkxpZFWgE1sDz/ with UiPassword disabled.
Content-type of http://127.0.0.1:43110/14c5LUN73J7KKMznp9LvZWkxpZFWgE1sDz/fonts/material-icons/MaterialIcons-Regular.woff2 is application/octet-stream.
Enable UiPassword and reload site.
Content-type of http://127.0.0.1:43110/14c5LUN73J7KKMznp9LvZWkxpZFWgE1sDz/fonts/material-icons/MaterialIcons-Regular.woff2 is text/html; charset=utf-8 and browser blocks request because Access-Control-Allow-Origin header is missing.
Observed Results:
Fonts fail to load because of wrong content-type and missing Access-Control-Allow-Origin header.
I added print('getContentType called: file_name={}, content_type={}'.format(file_name, content_type)) to getContentType and this is what I got:
UiPassword disabled:
Step 1: Please describe your environment
Step 2: Describe the problem:
When UiPassword is enabled, some files, fonts are sent with
Content-Type: text/html; charset=utf-8
, getContentType doesn't get called on them. AlsoAccess-Control-Allow-Origin
header is missing.Steps to reproduce:
http://127.0.0.1:43110/14c5LUN73J7KKMznp9LvZWkxpZFWgE1sDz/
with UiPassword disabled.http://127.0.0.1:43110/14c5LUN73J7KKMznp9LvZWkxpZFWgE1sDz/fonts/material-icons/MaterialIcons-Regular.woff2
isapplication/octet-stream
.http://127.0.0.1:43110/14c5LUN73J7KKMznp9LvZWkxpZFWgE1sDz/fonts/material-icons/MaterialIcons-Regular.woff2
istext/html; charset=utf-8
and browser blocks request becauseAccess-Control-Allow-Origin
header is missing.Observed Results:
Fonts fail to load because of wrong content-type and missing
Access-Control-Allow-Origin
header. I addedprint('getContentType called: file_name={}, content_type={}'.format(file_name, content_type))
to getContentType and this is what I got: UiPassword disabled:UiPassword enabled:
Expected Results:
Zeronet sends fonts with right headers and browser loads them.