This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component
Fabien Potencier a8609e1eab merged branch lsmith77/add_patch_support (PR #1916)
Commits
-------

007e395 do not set a default CONTENT_TYPE for PATCH
fa2c027 Added support for the PATCH method

Discussion
----------

[2.1] [HttpFoundation] Added support for the PATCH method

http://tools.ietf.org/html/rfc2068#section-19.6.1.1
http://tools.ietf.org/html/rfc5789

---------------------------------------------------------------------------

by Seldaek at 2011/08/07 03:23:20 -0700

According to the spec it seems that PATCH requests shouldn't be of application/x-www-form-urlencoded content-type so it shouldn't match the first if, and in the second it's probably wrong to default to application/x-www-form-urlencoded, no?

---------------------------------------------------------------------------

by lsmith77 at 2011/08/07 03:31:48 -0700

Hmm you are right. I assumed the diff would be encoded as ``application/x-www-form-urlencoded`` but there indeed is no indication of that in the spec. But given that the second case would still need some sort of handling for PATCH, just not sure what exactly ``$defaults['CONTENT_TYPE']`` should be set to.

---------------------------------------------------------------------------

by Seldaek at 2011/08/07 03:48:53 -0700

As I understand it, a PATCH request must specify a content-type or it's invalid, so we could just skip the second behavior if no content-type is present.

As your first link says:

    The list of differences is in a format defined by the media type of the entity (e.g.,
    "application/diff") and MUST include sufficient information to allow
    the server to recreate the changes necessary to convert the original
    version of the resource to the desired version.

Sounds like PATCH is highly application specific, and not so standardized, probably because it's not very useful for most purposes.

---------------------------------------------------------------------------

by lsmith77 at 2011/08/07 04:02:43 -0700

Yes, but to me this means that the patch is actually correct aside from the fact that its setting a default Content-Type, which I just corrected (not sure if this use of switch is ok with our coding style). Now if the Content-Type does end up being ``application/x-www-form-urlencoded`` then I would say its correct to decode it.
2011-08-26 17:44:39 +02:00
..
BrowserKit merged branch sasezaki/BrowserKit_useragent (PR #1789) 2011-07-26 09:21:10 +02:00
ClassLoader [ClassLoader] fixed CS 2011-08-13 10:30:20 +02:00
Config [Config] removed extra whitespace. 2011-07-01 09:35:17 +02:00
Console Revert "expanded namespaces within phpdoc (special for PhpStorm)" 2011-08-13 19:27:36 +02:00
CssSelector [CssSelector] fixed exception namespace 2011-06-29 19:11:00 +02:00
DependencyInjection [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
DomCrawler Merge branch 'domcrawler-disabled-fields' 2011-08-23 16:00:30 +02:00
EventDispatcher [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Finder [Finder] added a convenience method Finder::create() 2011-06-14 14:18:24 +02:00
Form merged branch stloyd/issue_1986 (PR #2000) 2011-08-23 08:44:09 +02:00
HttpFoundation merged branch lsmith77/add_patch_support (PR #1916) 2011-08-26 17:44:39 +02:00
HttpKernel updated VERSION and deps 2011-08-26 09:59:43 +02:00
Locale [Locale] fixed CS 2011-06-24 01:49:48 +02:00
Process [Process] fixed CS 2011-07-12 08:16:22 +02:00
Routing Revert "expanded namespaces within phpdoc (special for PhpStorm)" 2011-08-13 19:27:36 +02:00
Security merged branch Abhoryo/patch-1 (PR #1956) 2011-08-23 08:52:35 +02:00
Serializer Added $format in serialize() method, to keep consistence and give a hint to the normalizer. 2011-08-12 12:01:28 +03:00
Templating [Templating] tagged the public @api 2011-07-20 10:27:25 +02:00
Translation removed usage of \Exception as PHPUnit won't allow to catch them anymore in the next major version 2011-07-11 11:54:00 +02:00
Validator merged branch hidenorigoto/validator_pattern_late_static_bind (PR #1914) 2011-08-19 14:11:41 +02:00
Yaml [Yaml] made a small optimization 2011-08-22 15:06:47 +02:00