michael-lazar / flask-gopher

A Flask extension to support the Gopher protocol
GNU General Public License v3.0
77 stars 6 forks source link

Investigate behavior with werkzeug >= 1.0.0 #9

Open michael-lazar opened 4 years ago

michael-lazar commented 4 years ago

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 commented 4 years ago

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"