Skip to content

Request parsing fails when using Werkzeug>2.0.3  #39

Open
@mofe23

Description

@mofe23

Hi,
let's start with the good news: THX for your code, after initial debugging it did exactly what i was looking for :)

Now the bad ones:

After solving installation problems of wxPython by running pip install attrdict3 before installing orangeshare, I've discovered further problems using Python 3.10 on ArchLinux:

When I tried to add a new device, an alert popped up saying

Error: {"message": "The browser (or proxy) sent a request that this server could not understand."}

After some initial confusion, I discovered the problem was introduced in Werkzeug's version 2.1.0 by a change of Request.get_json() now raising BadRequest Errors if ContentType not explicitly set to application/json.

Several ways to fix orangeshare exist. I've confirmed setting contentType="application/json" and using JSON.stringify for every $.post works. Also, installing Wertkzeug==2.0.3 fixes the issue, but I think explicitly setting location="form" in RequestParser.add_argument is the "most correct" fix, as is keeps your initial intent of sending FormData and as you're rewriting the server side anyway, I'd prefer not to change the JS part --> PR incoming!.

Furthermore, to prevent issues like this one introduced by 3rd party updates, I'd recommend pinning dependencies to versions known to work.

Have a good one,
Mo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions