Skip to content

Commit

Permalink
fix(android): properly proxy requests to domains in allowNavigation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Nov 6, 2019
1 parent 8952ed1 commit 4a1c19f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -886,4 +886,8 @@ public String getLocalUrl() {
public WebViewLocalServer getLocalServer() {
return localServer;
}

public HostMask getAppAllowNavigationMask() {
return appAllowNavigationMask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
return null;
}

if (isLocalFile(loadingUrl) || Config.getString("server.url") == null) {
if (isLocalFile(loadingUrl) || (Config.getString("server.url") == null && !bridge.getAppAllowNavigationMask().matches(loadingUrl.getHost()))) {
Log.d(LogUtils.getCoreTag(), "Handling local request: " + request.getUrl().toString());
return handleLocalRequest(request, handler);
} else {
Expand Down

0 comments on commit 4a1c19f

Please sign in to comment.