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

Added Windows support and removed some panics #1264

Merged
merged 1 commit into from Apr 9, 2022

Conversation

mxmauro
Copy link
Contributor

@mxmauro mxmauro commented Apr 8, 2022

This PR aims to fix #1101 and improve the changes proposed by #1108

List of changes:

  • Handling and proper conversion from/to backslashes.
  • rootFS.Root is now empty and ServeFile has the control to convert a relative path to absolute.
  • Using filepath.IsAbs to detect if a path is absolute or relative.

Extras:

  • Some minor code linting.
  • Removed panics and now an error is returned. Crashing an app because the underlying OS calls does not work as expected, is not good. Also the function that may panic, already returns an errors for other situations.

@mxmauro
Copy link
Contributor Author

mxmauro commented Apr 8, 2022

Hi, I seeing the Windows test some times throws timeout in different PRs. Is it possible to run the checks again? BTW: Tested also on my Windows machine.

@erikdubbelboer
Copy link
Collaborator

Looks sane to me. Thanks!

@erikdubbelboer erikdubbelboer merged commit c7576cc into valyala:master Apr 9, 2022
@mxmauro
Copy link
Contributor Author

mxmauro commented Apr 9, 2022

You are welcome and thanks also to you.

@mxmauro mxmauro deleted the windows_fs branch April 15, 2022 22:08
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.

FS handlers don't cooperate well with handleRequest on Windows
2 participants