Skip to content
New issue

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

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

Already on GitHub? # to your account

File URL's are not handled correctly in Windows systems #12

Closed
pablochacin opened this issue Jul 12, 2024 · 0 comments · Fixed by #43
Closed

File URL's are not handled correctly in Windows systems #12

pablochacin opened this issue Jul 12, 2024 · 0 comments · Fixed by #43

Comments

@pablochacin
Copy link
Collaborator

pablochacin commented Jul 12, 2024

The file cache creates a file URL to the object of the form: file:///path/to/object (see Store and Get methods)

In windows systems, the resulting URL is file://C:/path/to/object. When this URL is parsed in the Download method, it throws an error because the C: component is interpreted as a host (with a missing port).

One solution is to implement this proposal: net/url: add FromFilePath and ToFilePath as platform dependent functions (with different implementations in Linux and Window systems).

An implementation of this proposal can be found here: https://go-review.googlesource.com/c/vuln/+/438175/7/internal/web/url.go

This was referenced Oct 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant