Skip to content

[Bug] Sanic-ext breaks @app.route(unquote=True) #148

Closed
@xmcp

Description

@xmcp

Describe the bug
Sanic v21.3 adds the unquote arg in @app.route to url-decode parameters in routes. But when sanic-ext is loaded, parameters will not be decoded even unquote is set.

Screenshots
Not related to swagger.

To Reproduce

from sanic import Sanic
from sanic.response import text

app = Sanic("test")
#app.config.AUTO_EXTEND = False

@app.route("/<param:str>", methods=["GET"], unquote=True)
async def handler2(request, param):
    return text("OK2 " + param)

Then visit http://127.0.0.1:8000/%E5%95%8A and find that it returns OK2 %E5%95%8A.

Expected behavior
The page should return OK2 啊.

Environment (please complete the following information):

  • OS: Windows 10
  • Browser: not related
  • Version sanic==22.9.0, sanic-ext==22.9.0

Additional context
After uncommenting app.config.AUTO_EXTEND = False in the script above, sanic works as expected. So this issue is caused by sanic-ext.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions