flask-gopher icon indicating copy to clipboard operation
flask-gopher copied to clipboard

Investigate behavior with werkzeug >= 1.0.0

Open michael-lazar opened this issue 5 years ago • 1 comments

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.

michael-lazar avatar Apr 11 '20 04:04 michael-lazar

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"

michael-lazar avatar Apr 11 '20 04:04 michael-lazar