Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect text/html header detection in the middleware #65

Open
bfontaine opened this issue Mar 26, 2022 · 1 comment
Open

Incorrect text/html header detection in the middleware #65

bfontaine opened this issue Mar 26, 2022 · 1 comment

Comments

@bfontaine
Copy link

Hello,
The middleware looks for a header Content-Type whose value is exactly text/html. However Flask’s default is text/html; charset=utf-8. Using this middleware as-is in a Flask app thus doesn’t work.

@bfontaine
Copy link
Author

Well even if I fix this the middleware still fails:

    return [self.minifier.minify(*html)]
  File "...-py3.9/lib/python3.9/site-packages/htmlmin/main.py", line 162, in minify
    self.input(*input)
  File "...-py3.9/lib/python3.9/site-packages/htmlmin/main.py", line 174, in input
    self._parser.feed(i)
  File "...-py3.9/lib/python3.9/site-packages/htmlmin/python3html/parser.py", line 124, in feed
    self.rawdata = self.rawdata + data
TypeError: can only concatenate str (not "bytes") to str

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant