summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-03-05 22:42:21 +0100
committerDavid Lawrence <dkl@mozilla.com>2015-03-05 22:42:21 +0100
commita693373f939d1d010b2e6ca37fe1a0f11868c23b (patch)
treed831f896543fdb63e673147b03766c98372398db /extensions
parent0a01905ba06a9ddada58cb63a8f77356ecf02eef (diff)
downloadbugzilla-a693373f939d1d010b2e6ca37fe1a0f11868c23b.tar.gz
bugzilla-a693373f939d1d010b2e6ca37fe1a0f11868c23b.tar.xz
Bug 1139939: "BadResponse: 'Location' header missing from 201 Created response" when commenting with bztools
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BzAPI/Extension.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/extensions/BzAPI/Extension.pm b/extensions/BzAPI/Extension.pm
index e6159243a..54a1dca0f 100644
--- a/extensions/BzAPI/Extension.pm
+++ b/extensions/BzAPI/Extension.pm
@@ -158,6 +158,12 @@ sub webservice_rest_response {
if (my $handler = _find_handler($rpc, 'response')) {
&$handler($result, $response);
}
+
+ # Add a Location header if a newly created resource
+ # such as a bug or comment.
+ if ($rpc->bz_success_code == STATUS_CREATED && $$result->{ref}) {
+ $response->header("Location", $$result->{ref});
+ }
}
sub webservice_rest_resources {