twisted.web.http requestReceived should accept patch and put as well as post.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 10
Description
| @yombo reported | |
|---|---|
| Trac ID | trac#9759 |
| Type | enhancement |
| Created | 2020-01-21 05:39:31Z |
Issue
Twisted web http requestReceived method only processes data from "form-data" or "x-www-form-urlencoded" if the method is POST(rfc 2616). However, PATCH (rfc 5789) and PUT (rfc 2616) are valid methods for manipulating resources as well.
Reference
Only accepts "POST" for trying to parse arguments. However, PATCH and PUT should also attempt to get arguments as well.
According to: https://restfulapi.net/http-methods/ (any many other references)
POST: New record
PATCH: Partial update of record
PUT: Update existing record
Possible fix
- Would you accept a PR that changes this line:
if self.method == b"POST" and ctype and clength:
To:
if self.method in (b"POST", b"PATCH", b"PUT") and ctype and clength:
Searchable metadata
trac-id__9759 9759
type__enhancement enhancement
reporter__yombo yombo
priority__normal normal
milestone__None None
branch__
branch_author__
status__new new
resolution__None None
component__web web
keywords__None None
time__1579585171188304 1579585171188304
changetime__1586941540576717 1586941540576717
version__None None
owner__None None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/twisted/web/http.py at the requestReceived method and review the existing form-data and x-www-form-urlencoded parsing condition. Check how PATCH and PUT requests are handled alongside POST, then verify that arguments are parsed for all three methods without changing other request behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, networking
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100