summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Bug.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-08-09 19:10:51 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-08-09 19:10:51 +0200
commit37ce30c4eabef0d10e3bfdff0ee9669f6fe5c7df (patch)
tree2fb75ca52ed0ba0285db69ccee064ebfbeb3be40 /Bugzilla/WebService/Bug.pm
parentc1a59a49a014f332793bbc9b3bea8717718428e5 (diff)
downloadbugzilla-37ce30c4eabef0d10e3bfdff0ee9669f6fe5c7df.tar.gz
bugzilla-37ce30c4eabef0d10e3bfdff0ee9669f6fe5c7df.tar.xz
Bug 569177 - Add support for eTag for WebServices
r/a=glob
Diffstat (limited to 'Bugzilla/WebService/Bug.pm')
-rw-r--r--Bugzilla/WebService/Bug.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index c639084ef..58405c2d0 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -349,6 +349,18 @@ sub get {
push(@bugs, $self->_bug_to_hash($bug, $params));
}
+ # Set the ETag before inserting the update tokens
+ # since the tokens will always be unique even if
+ # the data has not changed.
+ $self->bz_etag(\@bugs);
+
+ if (Bugzilla->user->id) {
+ foreach my $bug (@bugs) {
+ my $token = issue_hash_token([$bug->{'id'}, $bug->{'last_change_time'}]);
+ $bug->{'update_token'} = $self->type('string', $token);
+ }
+ }
+
return { bugs => \@bugs, faults => \@faults };
}
@@ -986,11 +998,6 @@ sub _bug_to_hash {
}
}
- if (Bugzilla->user->id) {
- my $token = issue_hash_token([$bug->id, $bug->delta_ts]);
- $item{'update_token'} = $self->type('string', $token);
- }
-
# The "accessible" bits go here because they have long names and it
# makes the code look nicer to separate them out.
$item{'is_cc_accessible'} = $self->type('boolean',