Bug 959033 - Don't send X-Confirm-Delete header with Android Sync requests. r?grisha draft
authorkimsaehun <kimsaehun@csu.fullerton.edu>
Thu, 03 Aug 2017 16:26:45 -0700
changeset 620897 70332a482887
parent 620658 36ad88e6b7b2
child 640838 2439d8616763
push id72187
push userbmo:kimsaehun@csu.fullerton.edu
push dateFri, 04 Aug 2017 02:52:34 +0000
reviewersgrisha
bugs959033
milestone57.0a1
Bug 959033 - Don't send X-Confirm-Delete header with Android Sync requests. r?grisha MozReview-Commit-ID: AQqcfeX9TlA
mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/SyncStorageRequest.java
mobile/android/tests/background/junit4/src/org/mozilla/android/sync/net/test/TestSyncStorageRequest.java
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/SyncStorageRequest.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/SyncStorageRequest.java
@@ -153,19 +153,16 @@ public class SyncStorageRequest implemen
     @Override
     public void addHeaders(HttpRequestBase request, DefaultHttpClient client) {
       // Clients can use their delegate interface to specify X-If-Unmodified-Since.
       String ifUnmodifiedSince = this.request.delegate.ifUnmodifiedSince();
       if (ifUnmodifiedSince != null) {
         Logger.debug(LOG_TAG, "Making request with X-If-Unmodified-Since = " + ifUnmodifiedSince);
         request.setHeader("x-if-unmodified-since", ifUnmodifiedSince);
       }
-      if (request.getMethod().equalsIgnoreCase("DELETE")) {
-        request.addHeader("x-confirm-delete", "1");
-      }
     }
   }
 
   protected BaseResourceDelegate resourceDelegate;
   public SyncStorageRequestDelegate delegate;
   protected BaseResource resource;
 
   // Default implementation. Override this.
--- a/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/net/test/TestSyncStorageRequest.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/net/test/TestSyncStorageRequest.java
@@ -245,18 +245,16 @@ public class TestSyncStorageRequest {
     r.delegate = delegate;
     r.post(new JSONObject());
     // Server is stopped in the callback.
   }
 
   public class DeleteMockServer extends MockServer {
     @Override
     public void handle(Request request, Response response) {
-      assertNotNull(request.getValue("x-confirm-delete"));
-      assertEquals("1", request.getValue("x-confirm-delete"));
       super.handle(request, response);
     }
   }
 
   @Test
   public void testDelete() throws URISyntaxException {
     BaseResource.rewriteLocalhost = false;
     data.startHTTPServer(new DeleteMockServer());