Bug 959033 - Don't send X-Confirm-Delete header with Android Sync requests. r=Grisha
authorkimsaehun <kimsaehun@csu.fullerton.edu>
Thu, 03 Aug 2017 16:26:45 -0700
changeset 372869 01ea7fe459c1
parent 372868 2a890e5dcdfd
child 372870 ebb30b6d6184
push id48003
push usergkruglov@mozilla.com
push dateFri, 04 Aug 2017 08:24:07 +0000
treeherderautoland@01ea7fe459c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGrisha
bugs959033
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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());