mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-09-21 03:29:47 +02:00
fix: out of bounds index when rewriting websocket headers
This commit is contained in:
@@ -75,5 +75,9 @@ func SplitUpDownStreamHeaders(rewriteOptions *HeaderRewriteOptions) ([][]string,
|
||||
downstreamHeaderCounter++
|
||||
}
|
||||
|
||||
// Slice the arrays to only include the filled portions to prevent nil slice access
|
||||
upstreamHeaders = upstreamHeaders[:upstreamHeaderCounter]
|
||||
downstreamHeaders = downstreamHeaders[:downstreamHeaderCounter]
|
||||
|
||||
return upstreamHeaders, downstreamHeaders
|
||||
}
|
||||
|
Reference in New Issue
Block a user