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

fix: add hostname check to decide http mode in windows #739

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Conversation

im-adithya
Copy link
Member

@im-adithya im-adithya commented Oct 16, 2024

Description

Unlike Linux and Darwin, Windows doesn't allow wails:// protocol without having NSIS installer. So wails uses http://wails.localhost in Windows. This leads to the HTTP backup endpoint being requested in Windows which results in 405 Method Not Allowed

@im-adithya im-adithya changed the title chore: protocol check fix: add hostname check to decide http mode in windows Oct 16, 2024
@bumi
Copy link
Contributor

bumi commented Oct 16, 2024

good debugging.
how is the HTTP endpoint being requested? what URL is exposed there?

@@ -8,7 +8,9 @@ type Props = {
};

export default function ExternalLink({ to, className, children }: Props) {
const isHttpMode = window.location.protocol.startsWith("http");
const isHttpMode =
Copy link
Contributor

Choose a reason for hiding this comment

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

can we extract this check now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah best to do that, but where should this live? frontend/src/utils/ishttpmode.ts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I'm not sure we should do this and actually just use a NSIS installer, if that is not much extra work

Copy link
Contributor

Choose a reason for hiding this comment

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

We decided to keep as-is. Since the check is more complicated now I think extracting it into frontend/src/utils/isHttpMode.ts would be good.

And we said we might want to do a hotfix. I will make a new milestone for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@rolznz rolznz modified the milestones: v1.11.0, v1.10.3 Oct 17, 2024
Copy link
Contributor

@rolznz rolznz left a comment

Choose a reason for hiding this comment

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

utACK

@rolznz rolznz merged commit 0e9abe5 into master Oct 22, 2024
9 checks passed
@rolznz rolznz deleted the task-node-bkp branch October 22, 2024 13:26
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.

3 participants