Bug 1325876 Comment 32 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Disabling below chunk of code strangely fixed the problem on Android (using `#ifndef ANDROID`).. Seems like [generic1.html](https://searchfox.org/mozilla-central/source/mobile/android/fenix/app/src/androidTest/assets/pages/generic1.html) has a `contentLength` of 0 then returns `responseCode` above 400 (confirmed that `rv` did not fail). Also confirmed that the error passed [here](https://searchfox.org/mozilla-central/rev/5a7e5e2e1fe04028fc77787084caf9b26ab74ce6/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt#1245) is [`ERROR_UNKNOWN`](https://searchfox.org/mozilla-central/rev/2493c256dbff4e3c7e51a7fc61115df887b87e9e/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequestError.java#95) on Fenix.
```
    if (NS_FAILED(rv) || contentLength <= 0) {
      if (responseCode >= 500) {
        return NS_ERROR_NET_ERROR_RESPONSE;
      }
      if (responseCode >= 400) {
        return NS_ERROR_NET_EMPTY_RESPONSE;
      }
    }
```
Responsible patch: https://phabricator.services.mozilla.com/D220193
Disabling below chunk of code strangely fixed the [problem](https://treeherder.mozilla.org/logviewer?job_id=487292095&repo=try&lineNumber=3382) on Android (using `#ifndef ANDROID`).. Seems like [generic1.html](https://searchfox.org/mozilla-central/source/mobile/android/fenix/app/src/androidTest/assets/pages/generic1.html) has a `contentLength` of 0 then returns `responseCode` above 400 (confirmed that `rv` did not fail). Also confirmed that the error passed [here](https://searchfox.org/mozilla-central/rev/5a7e5e2e1fe04028fc77787084caf9b26ab74ce6/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt#1245) is [`ERROR_UNKNOWN`](https://searchfox.org/mozilla-central/rev/2493c256dbff4e3c7e51a7fc61115df887b87e9e/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequestError.java#95) on Fenix.
```
    if (NS_FAILED(rv) || contentLength <= 0) {
      if (responseCode >= 500) {
        return NS_ERROR_NET_ERROR_RESPONSE;
      }
      if (responseCode >= 400) {
        return NS_ERROR_NET_EMPTY_RESPONSE;
      }
    }
```
Responsible patch: https://phabricator.services.mozilla.com/D220193

Back to Bug 1325876 Comment 32