Skip to content

Commit

Permalink
Bug Fix:Access the custom URL path after setting the password
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann0617 committed Jul 22, 2024
1 parent 73f810a commit 7a43b59
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ yohannfan/yohann-netdisc:latest
![image](https://github.com/Yohann0617/tgNetDisc/assets/75626191/844a61aa-cfd2-40b3-b63c-bb9de0fb8438)
![image](https://github.com/Yohann0617/tgNetDisc/assets/75626191/227b83af-7c83-4b22-ba89-9f21606e44e9)

## API请求示例
```bash
curl -X POST -F "image=@/root/test/tgNetDisc;type=application/octet-stream" https://hh.abc.com/api
```
如果设置了密码:
```bash
curl -X POST -F "image=@/root/test/tgNetDisc;type=application/octet-stream" -b "p=YOURPASSWORD" https://hh.abc.com/api
```

## Stargazers over time

[![Stargazers over time](https://starchart.cc/Yohann0617/tgNetDisc.svg)](https://starchart.cc/Yohann0617/tgNetDisc)
9 changes: 9 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ For cloud storage mode, use the -mode pan parameter, like this:
![image](https://github.com/Yohann0617/tgNetDisc/assets/75626191/729b766c-0cb0-49d3-bca0-130a98867368)
![image](https://github.com/Yohann0617/tgNetDisc/assets/75626191/227b83af-7c83-4b22-ba89-9f21606e44e9)

## API request example
```bash
curl -X POST -F "image=@/root/test/tgNetDisc;type=application/octet-stream" https://hh.abc.com/api
```
If a password is set:
```bash
curl -X POST -F "image=@/root/test/tgNetDisc;type=application/octet-stream" -b "p=YOURPASSWORD" https://hh.abc.com/api
```

## Stargazers over time

[![Stargazers over time](https://starchart.cc/Yohann0617/tgNetDisc.svg)](https://starchart.cc/Yohann0617/tgNetDisc)
Expand Down
2 changes: 1 addition & 1 deletion control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func Pwd(w http.ResponseWriter, r *http.Request) {
Value: r.FormValue("p"),
}
http.SetCookie(w, &cookie)
http.Redirect(w, r, "/", http.StatusSeeOther)
http.Redirect(w, r, conf.Domain, http.StatusSeeOther)
}

func Middleware(next http.HandlerFunc) http.HandlerFunc {
Expand Down

0 comments on commit 7a43b59

Please sign in to comment.