[M108 Aura Migration][NaCl][PPAPI] URLResponseInfo response code 0 15/290515/2
authorjinbei09 <jinbei09.dai@samsung.com>
Tue, 28 Mar 2023 03:01:53 +0000 (11:01 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 28 Mar 2023 06:20:01 +0000 (06:20 +0000)
URLResponseInfo response code 0 if file is loaded via file:// protocol.

Ported patches from M94:
  https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/280897/

Change-Id: I6cdde453283cac23957e506fd4b5d685af71ce84
Signed-off-by: jinbei09 <jinbei09.dai@samsung.com>
content/renderer/pepper/url_response_info_util.cc

index be81007..e178a86 100644 (file)
@@ -48,6 +48,15 @@ ppapi::URLResponseInfoData DataFromWebURLResponse(
   ppapi::URLResponseInfoData data;
   data.url = response.CurrentRequestUrl().GetString().Utf8();
   data.status_code = response.HttpStatusCode();
+#if BUILDFLAG(IS_TIZEN_TV)
+  // Tizen API responses code 0 instead of HTTP 200 indicating OK, when file
+  // is loaded using file:// protocol.
+  GURL url = response.CurrentRequestUrl();
+  if (url.SchemeIsFile()) {
+    if (data.status_code == 0)
+      data.status_code = 200;
+  }
+#endif
   data.status_text = response.HttpStatusText().Utf8();
   if (IsRedirect(data.status_code)) {
     data.redirect_url =