mirror of
https://github.com/minoplhy/chibisafe-netproxy.git
synced 2024-11-22 03:27:08 +00:00
fix: X-Real-IP condition
This commit is contained in:
parent
14e819e09b
commit
b5dfbf5395
8
main.go
8
main.go
@ -90,8 +90,8 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
|
|
||||||
if handler.IsInternalIP(r.RemoteAddr) {
|
if r.Header.Get("X-Real-IP") != "" && handler.IsInternalIP(r.RemoteAddr) {
|
||||||
UploadHeaders["X-Real-IP"] = r.RemoteAddr
|
UploadHeaders["X-Real-IP"] = r.Header.Get("X-Real-IP")
|
||||||
}
|
}
|
||||||
|
|
||||||
chibisafe_post, err := handler.UploadPost(Chibisafe_basepath, UploadHeaders, PostData)
|
chibisafe_post, err := handler.UploadPost(Chibisafe_basepath, UploadHeaders, PostData)
|
||||||
@ -134,8 +134,8 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
|
|
||||||
if handler.IsInternalIP(r.RemoteAddr) {
|
if r.Header.Get("X-Real-IP") != "" && handler.IsInternalIP(r.RemoteAddr) {
|
||||||
ProcessHeaders["X-Real-IP"] = r.RemoteAddr
|
ProcessHeaders["X-Real-IP"] = r.Header.Get("X-Real-IP")
|
||||||
}
|
}
|
||||||
|
|
||||||
PostProcess, err := handler.UploadProcessPost(Chibisafe_basepath, ProcessHeaders, PostProcessData)
|
PostProcess, err := handler.UploadProcessPost(Chibisafe_basepath, ProcessHeaders, PostProcessData)
|
||||||
|
Loading…
Reference in New Issue
Block a user