summaryrefslogtreecommitdiffstats
path: root/extensions/BzAPI/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BzAPI/Extension.pm')
-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 {