Browse Source

Merge pull request #2683 from insertjokehere/fix_error_on_successful_webhook

Treat any 2xx webhook response status code as success
Lauri Ojansivu 5 năm trước cách đây
mục cha
commit
ea26f70669
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      server/notifications/outgoing.js

+ 1 - 1
server/notifications/outgoing.js

@@ -124,7 +124,7 @@ Meteor.methods({
     const url = integration.url;
     const url = integration.url;
     const response = postCatchError(url, options);
     const response = postCatchError(url, options);
 
 
-    if (response && response.statusCode && response.statusCode === 200) {
+    if (response && response.statusCode && response.statusCode >= 200 && response.statusCode < 300) {
       if (is2way) {
       if (is2way) {
         const cid = params.commentId;
         const cid = params.commentId;
         const tooSoon = Lock.has(cid); // if an activity happens to fast, notification shouldn't fire with the same id
         const tooSoon = Lock.has(cid); // if an activity happens to fast, notification shouldn't fire with the same id