Skip to content

fix cbv route registration on / - #394

Open
nggit wants to merge 1 commit into
mainfrom
routes
Open

fix cbv route registration on /#394
nggit wants to merge 1 commit into
mainfrom
routes

Conversation

@nggit

@nggit nggit commented Sep 8, 2026

Copy link
Copy Markdown
Owner

When using Class-Based with /:

@app.route('/')
class HelloWorld:
    async def get(self, request):
        return 'GET'

    async def post(self, request):
        return 'POST'

Only the last method or post() is registered. If you do GET, it won't serve the get() but "Method Not Allowed" instead. Like it was not there/not implemented.

/ is really a special case. There is default "Service Unavailable" handler when no route is registered.

But this PR fixes this and with all existing considerations.

@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant