Skip to content

fix cbv route registration on / - #394

Merged
nggit merged 1 commit into
mainfrom
routes
Oct 1, 2026
Merged

nggit merged 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

@nggit
nggit merged commit c778aef into main Oct 1, 2026
40 of 41 checks passed
@nggit
nggit deleted the routes branch October 1, 2026 12:16
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