@@ -30,6 +30,7 @@ import androidx.core.net.toUri
30
30
import androidx.core.os.bundleOf
31
31
import androidx.fragment.app.Fragment
32
32
import be.mygod.reactmap.App.Companion.app
33
+ import be.mygod.reactmap.BuildConfig
33
34
import be.mygod.reactmap.R
34
35
import be.mygod.reactmap.follower.BackgroundLocationReceiver
35
36
import be.mygod.reactmap.util.UnblockCentral
@@ -194,7 +195,9 @@ abstract class BaseReactMapFragment : Fragment(), DownloadListener {
194
195
override fun onPageStarted (view : WebView , url : String , favicon : Bitmap ? ) {
195
196
glocation.clear()
196
197
val uri = url.toUri()
197
- if (" http" .equals(uri.scheme, true )) web.loadUrl(uri.buildUpon().scheme(" https" ).build().toString())
198
+ if (! BuildConfig .DEBUG && " http" .equals(uri.scheme, true )) {
199
+ web.loadUrl(uri.buildUpon().scheme(" https" ).build().toString())
200
+ }
198
201
if (uri.host == hostname) glocation.setupGeolocation()
199
202
onPageStarted()
200
203
}
@@ -216,15 +219,15 @@ abstract class BaseReactMapFragment : Fragment(), DownloadListener {
216
219
}
217
220
" http" .equals(parsed.scheme, true ) -> {
218
221
Snackbar .make(view, R .string.error_https_only, Snackbar .LENGTH_SHORT ).show()
219
- true
222
+ ! BuildConfig . DEBUG
220
223
}
221
224
else -> false
222
225
}
223
226
}
224
227
225
228
override fun shouldInterceptRequest (view : WebView ? , request : WebResourceRequest ): WebResourceResponse ? {
226
229
val path = request.url.path ? : return null
227
- if (" https " .equals(request.url.scheme, true ) && request.url.host == hostname) {
230
+ if (request.url.host == hostname) {
228
231
if (path == " /api/settings" ) return handleSettings(request)
229
232
if (path.startsWith(" /locales/" ) && path.endsWith(" /translation.json" )) {
230
233
return handleTranslation(request)
0 commit comments