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(i3s): slpk full path on Windows #3011

Merged
merged 2 commits into from
May 20, 2024
Merged

Conversation

belom88
Copy link
Collaborator

@belom88 belom88 commented May 17, 2024

Conversion of local *.slpk files fails on Windows...

@belom88 belom88 requested a review from ibgreen May 17, 2024 10:33
@belom88 belom88 added this to the 4.2.2 milestone May 17, 2024

try {
const urlObj = new URL(url);
urlWithoutParams = `${urlObj.origin}${urlObj.pathname}`;

// On Windows `new URL(url)` makes `C:\...` -> `null\...`
if (urlWithoutParams.startsWith('null')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Allowing the string to become malformed and then fixing it up seems a bit sloppy. I would prefer that we checked before we formed the string (in this case I assume we could check urlObj.origin?)

@belom88 belom88 merged commit 1038f6f into master May 20, 2024
1 check passed
@belom88 belom88 deleted the vb/fix-slpk-full-path-on-windows branch May 20, 2024 08:33
belom88 added a commit that referenced this pull request May 20, 2024
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.

None yet

2 participants