mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-07 05:38:30 +02:00
Fixed #235
- Added flush sniffing for keep-alive request - Set default flush interval to 100ms for hostname and 500ms for virtual directory
This commit is contained in:
@@ -3,6 +3,7 @@ package dpcore
|
||||
import (
|
||||
"mime"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -17,6 +18,12 @@ func (p *ReverseProxy) getFlushInterval(req *http.Request, res *http.Response) t
|
||||
return -1
|
||||
}
|
||||
|
||||
// Fixed issue #235: Added auto detection for ollama / llm output stream
|
||||
connectionHeader := req.Header["Connection"]
|
||||
if len(connectionHeader) > 0 && strings.Contains(strings.Join(connectionHeader, ","), "keep-alive") {
|
||||
return -1
|
||||
}
|
||||
|
||||
//Cannot sniff anything. Use default value
|
||||
return p.FlushInterval
|
||||
|
||||
|
Reference in New Issue
Block a user