fix: force
This commit is contained in:
parent
5751f1d0c7
commit
31a157ea96
@ -1,4 +1,4 @@
|
||||
# HMAC File Server 2.5-Stable
|
||||
# HMAC File Server 2.6-Stable
|
||||
|
||||
## Overview
|
||||
The **HMAC File Server** ensures secure file uploads and downloads using HMAC authentication. It incorporates rate limiting, CORS support, retries, file versioning, and Unix socket support for enhanced flexibility. Redis integration provides efficient caching and session management. Prometheus metrics and a graceful shutdown mechanism ensure reliable and efficient file handling.
|
||||
|
@ -2092,6 +2092,7 @@ func handleChunkedUpload(tempFilename string, r *http.Request, chunkSize int) er
|
||||
buffer := make([]byte, chunkSize)
|
||||
|
||||
totalBytes := int64(0)
|
||||
originalIP := r.RemoteAddr
|
||||
for {
|
||||
n, err := r.Body.Read(buffer)
|
||||
if err != nil && err != io.EOF {
|
||||
@ -2101,6 +2102,12 @@ func handleChunkedUpload(tempFilename string, r *http.Request, chunkSize int) er
|
||||
break
|
||||
}
|
||||
|
||||
currentIP := r.RemoteAddr
|
||||
if currentIP != originalIP {
|
||||
log.Warnf("IP changed from %s to %s, terminating transfer", originalIP, currentIP)
|
||||
return fmt.Errorf("client IP changed during transfer")
|
||||
}
|
||||
|
||||
_, err = writer.Write(buffer[:n])
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write to file: %v", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user