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

hertz使用hertz.Static时,如果注册了相对路径,请求时会出现相对路径重复两遍而导致文件找不到的情况 #1000

Closed
UserLooper opened this issue Nov 16, 2023 · 3 comments
Labels
question Further information is requested

Comments

@UserLooper
Copy link

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Hertz version:

Please provide the version of Hertz you are using.

Environment:

The output of go env.

Additional context

Add any other context about the problem here.

@UserLooper
Copy link
Author

hertz.Static("/static", "./static")

[Error] HERTZ: Cannot open file="./static/static/index.html", error=open ./static/static/index.html: no such file or directory

请求是/static/index.html

@li-jin-gou li-jin-gou added the question Further information is requested label Nov 16, 2023
@li-jin-gou
Copy link
Member

@UserLooper #400 看下是不是这个问题

@UserLooper
Copy link
Author

@UserLooper #400看下不是这个问题

看起来是的,我理解为relativePath是http请求的路径,看起来不是,只是文件的子路径

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants