Skip to content

Aiohttp doesn't return any error on invalid request methods #4798

@grossmj

Description

@grossmj

🐞 Describe the bug

I ran the simple server example located in https://github.com/aio-libs/aiohttp/blob/master/examples/server_simple.py

Then sent an invalid GET1 request using CURL. There is no response from aiohttp and curl is blocked.

The original error was reported there: GNS3/gns3-server#1766 (GNS3 server uses aiohttp).

💡 To Reproduce

$ curl -X GET1 http://0.0.0.0:8080/
<no response, blocks until killed>

💡 Expected behavior

An HTTP error.

📋 Your version of the aiohttp distribution

$ python3 -m pip show aiohttp
Name: aiohttp
Version: 3.6.2
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: Nikolay Kim
Author-email: [email protected]
License: Apache 2
Location: /usr/local/lib/python3.6/dist-packages
Requires: typing-extensions, chardet, multidict, idna-ssl, attrs, async-timeout, yarl
Required-by: aiohttp-cors, pytest-aiohttp, gns3-server

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions