Skip to content

fix(tauri) embedded-server edge case with config host#26

Merged
nothingismagick merged 1 commit into
devfrom
feature/embedded-server-fix
Aug 22, 2019
Merged

fix(tauri) embedded-server edge case with config host#26
nothingismagick merged 1 commit into
devfrom
feature/embedded-server-fix

Conversation

@lucasfernog

Copy link
Copy Markdown
Member

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • New Binding Issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes. Issue #___
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch and not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • Any necessary documentation has been added or updated in the docs (for faster update click on "Suggest an edit on GitHub" at bottom of page) or explained in the PR's description.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

There's an edge case for how the webview and our embeddedServer loads its URLs.
When the config -> host is set to something like localhost or 127.0.0.1 (without http:// protocol), the server starts correctly, but the webview doesn't. We have to explicitely set the http protocol on the webview, but not on the embedded web server.

So, with this PR, we add the protocol for the webview load URL if its not there, and we always remove it from the config host. With this approach, the embedded web server MUST be served locally.

There are some other changes because I ran cargofmt.

@nothingismagick nothingismagick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am approving this to get it into dev so I can build our test/app

@nothingismagick nothingismagick merged commit 9e4a8c6 into dev Aug 22, 2019
@nothingismagick nothingismagick deleted the feature/embedded-server-fix branch September 12, 2019 20:41
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 this pull request may close these issues.

2 participants