mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
add 404 HTTP Error Handling
This commit is contained in:
parent
40c9ca5f38
commit
a1e8e3e373
1 changed files with 6 additions and 0 deletions
|
|
@ -132,6 +132,12 @@ func ChunkedProxyRequest(c *gin.Context, u string, cfg *config.Config, mode stri
|
|||
}
|
||||
*/
|
||||
|
||||
// 错误处理(404)
|
||||
if resp.StatusCode == 404 {
|
||||
c.String(http.StatusNotFound, "File Not Found")
|
||||
return
|
||||
}
|
||||
|
||||
contentLength = resp.Header.Get("Content-Length")
|
||||
if contentLength != "" {
|
||||
size, err := strconv.Atoi(contentLength)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue