flask-gopher
flask-gopher copied to clipboard
Investigate behavior with werkzeug >= 1.0.0
It appears that some recent updates to werkzeug have broken this plugin. I did a bit of digging and most of the relevant changes are around adding support for websockets. It might end up being infeasible to continue monkey-patching gopher compatibility (I hope not though!)
For now, I am going to pin the werkzeug dependency to < 1.0.0 and publish a new release.
Here's the code in question
https://github.com/pallets/werkzeug/blob/51860032cc780fa4a120b4a3c0457a36bbe91715/src/werkzeug/routing.py#L2177-L2181
If I change this as shown, I can get all of the tests to pass:
if websocket:
force_external = True
url_scheme = "wss" if secure else "ws"
elif url_scheme in ("http", "https"):
url_scheme = "https" if secure else "http"