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 422353 01ea7fe459c13b813be16b23035fa712e5bb874b
parent 422352 2a890e5dcdfd0b03371518baa13f3c6c3d7700bd
child 422354 ebb30b6d61849bcbd85d505c1e367528c6fb00f6
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [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());