mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
More robust key detection per feedback
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -3623,10 +3623,17 @@ func getHeader(key string, hdr []byte) []byte {
|
||||
if index < 0 {
|
||||
return nil
|
||||
}
|
||||
index += len(key)
|
||||
if index >= len(hdr) {
|
||||
return nil
|
||||
}
|
||||
if hdr[index] != ':' {
|
||||
return nil
|
||||
}
|
||||
index++
|
||||
|
||||
var value []byte
|
||||
hdrLen := len(hdr)
|
||||
index += len(key) + 1
|
||||
for hdr[index] == ' ' && index < hdrLen {
|
||||
index++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user