beta9 icon indicating copy to clipboard operation
beta9 copied to clipboard

Fix: Forward query parameters for endpoints and ASGI apps

Open dleviminzi opened this issue 1 year ago • 0 comments

Resolve BE-1941

Currently we are not forwarding query parameters for asgi apps. I discovered this while hosting a simple test asgi app with the endpoint

    @myapp.get("/sleep")
    async def sleep(seconds: int):
        time.sleep(seconds)
        return {"message": f"Slept for {seconds} seconds"}

Calling asgi-test-app/v2/sleep?seconds=0 yielded

{"detail":[{"type":"missing","loc":["query","seconds"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.5/v/missing"}]}

With this change I get the expected behavior.

dleviminzi avatar Oct 10 '24 19:10 dleviminzi