From: David Lawrence Date: Fri, 10 Apr 2015 15:34:53 +0000 (+0100) Subject: Bug 1051056: The REST API needs to be versioned so that new changes can be made that... X-Git-Tag: release-5.1.1~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06da34e74687de919804c87c8d5e15edbc570522;p=thirdparty%2Fbugzilla.git Bug 1051056: The REST API needs to be versioned so that new changes can be made that do not break compatibility - Fix issue where PUT requests were treated as GET and failed when updating a bug, etc. --- diff --git a/Bugzilla/API/1_0/Server.pm b/Bugzilla/API/1_0/Server.pm index 6136440cf2..108c25e274 100644 --- a/Bugzilla/API/1_0/Server.pm +++ b/Bugzilla/API/1_0/Server.pm @@ -260,7 +260,8 @@ sub _params_check { } } - if ($self->request->method eq 'POST') { + if ($self->request->method eq 'POST' + || $self->request->method eq 'PUT') { # CSRF is possible via XMLHttpRequest when the Content-Type header # is not application/json (for example: text/plain or # application/x-www-form-urlencoded).