add 404 HTTP Error Handling
This commit is contained in:
@@ -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")
|
contentLength = resp.Header.Get("Content-Length")
|
||||||
if contentLength != "" {
|
if contentLength != "" {
|
||||||
size, err := strconv.Atoi(contentLength)
|
size, err := strconv.Atoi(contentLength)
|
||||||
|
|||||||
Reference in New Issue
Block a user