Skip to content

request.POST now supports any requests with the appropriate Content-Type (#351)#352

Merged
digitalresistor merged 2 commits into
Pylons:masterfrom
Cykooz:master
Apr 5, 2018
Merged

request.POST now supports any requests with the appropriate Content-Type (#351)#352
digitalresistor merged 2 commits into
Pylons:masterfrom
Cykooz:master

Conversation

@Cykooz
Copy link
Copy Markdown
Contributor

@Cykooz Cykooz commented Mar 8, 2018

Issue #351

@Cykooz Cykooz changed the title request.POST now supports DELETE requests with the appropriate Content-Type (#351) request.POST now supports DELETE requests with the appropriate Content-Type (#351) Mar 8, 2018
@digitalresistor
Copy link
Copy Markdown
Member

Instead of limiting it to just certain request methods, it may be better to just look for content-type if it is not a POST, and if it is form-encoded then we can continue.

This way the WebDav request methods also just work.

Comment thread src/webob/request.py Outdated
"""
env = self.environ
if self.method not in ('POST', 'PUT', 'PATCH'):
if self.method not in ('POST', 'PUT', 'PATCH', 'DELETE'):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue for removal of this entirely, so that it just works on all request methods, Webdav has a bunch of other request methods for example and it doesn't make sense if we disallow .POST on those.

As long as we keep the line on 766 we should be good to go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a cool idea. I will remove this condition.

@Cykooz Cykooz changed the title request.POST now supports DELETE requests with the appropriate Content-Type (#351) request.POST now supports any requests with the appropriate Content-Type (#351) Mar 8, 2018
@Cykooz
Copy link
Copy Markdown
Contributor Author

Cykooz commented Mar 18, 2018

Ping-ping.

What about merging this PR?

@digitalresistor
Copy link
Copy Markdown
Member

I've been busy with work and the flu. I'm also traveling at the moment. I'll get this merged before I push the release for 1.8.

@digitalresistor digitalresistor added this to the 1.8.0 milestone Mar 20, 2018
@digitalresistor digitalresistor merged commit 1f91bcc into Pylons:master Apr 5, 2018
@digitalresistor
Copy link
Copy Markdown
Member

Thank you!

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.

2 participants