summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-03-01 14:35:48 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-08-28 16:40:25 +0200
commit998afa5f74558be215a924d95aa131a69831ca43 (patch)
tree500c242e2bacd966b3faf1a019f28edff2ee24d7 /lib/api/notes.rb
parent7ccef75a26bc4997e04c109007e6c6ee004574cb (diff)
downloadgitlab-ce-998afa5f74558be215a924d95aa131a69831ca43.tar.gz
API: Respect the 'If-Unmodified-Since' for delete endpoints
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 4e4e473994b..58d71787aca 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -129,7 +129,9 @@ module API
end
delete ":id/#{noteables_str}/:noteable_id/notes/:note_id" do
note = user_project.notes.find(params[:note_id])
+
authorize! :admin_note, note
+ check_unmodified_since(note.updated_at)
status 204
::Notes::DestroyService.new(user_project, current_user).execute(note)