From 78124926663624d31731a3baef64ddb6f0e1089c Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Thu, 19 Mar 2026 14:37:57 -0400 Subject: [PATCH] Identify gpx and kml files by file name not type. Windows browser clients do not provide a valid "type" for each file. Switching to parsing the file name extension instead works in both Windows and Linux. Bug: 461722505 Test: Run "cvd create" on a Linux host, access service from a Windows machine, verify importing gbx and kml files from the "Location console" works correctly. --- .../cvd/cuttlefish/host/frontend/webrtc/html_client/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/html_client/js/app.js b/base/cvd/cuttlefish/host/frontend/webrtc/html_client/js/app.js index d92173905ff..27a7d9399e8 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/html_client/js/app.js +++ b/base/cvd/cuttlefish/host/frontend/webrtc/html_client/js/app.js @@ -605,10 +605,10 @@ class DeviceControlApp { } var filename= file_selector.files[0]; - if (filename.type.match('\gpx')) { + if (filename.name.endsWith('.gpx')) { console.debug("import Gpx locations handling"); loadFile(onLoad_send_gpx_data); - } else if(filename.type.match('\kml')){ + } else if(filename.name.endsWith('.kml')){ console.debug("import Kml locations handling"); loadFile(onLoad_send_kml_data); }