Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capacitor object injection broken for URLs with path & allowNavigation #1772

Closed
1 task done
leshik opened this issue Jul 18, 2019 · 0 comments · Fixed by #1774
Closed
1 task done

Capacitor object injection broken for URLs with path & allowNavigation #1772

leshik opened this issue Jul 18, 2019 · 0 comments · Fixed by #1774

Comments

@leshik
Copy link
Contributor

leshik commented Jul 18, 2019

Once again, #1574 broke my use case.

Description of the problem:

Affected platform

  • Android

Other information: guessContentTypeFromStream isn't working.

Capacitor version: 1.1.0

Steps to reproduce:

Start a fresh project.

capacitor.config.json:

{
  "appId": "com.example.app",
  "appName": "App",
  "webDir": "www",
  "npmClient": "npm",
  "server": {
    "allowNavigation": [
      "github.com"
    ]
  },
  "android": {
    "webContentsDebuggingEnabled": true
  }
}

www/index.html:

<!DOCTYPE html>
<head>
  <script>
    location.href = 'https://github.com/leshik'
  </script>
</head>
<body>
</body>
</html>

Result: Capacitor object isn't injected.

In case the URL doesn't contain a path, e.g. https://github.com, the mime type gets detected by guessContentTypeFromName and the object is injected correctly. In case when it has to detect mime type from the stream, it fails.

@leshik leshik changed the title Capacitor object injection broken for URLs with path & AllowNavigation Capacitor object injection broken for URLs with path & allowNavigation Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant