mirror of
https://github.com/soypat/lneto.git
synced 2026-08-21 23:19:03 +00:00
tests passing babyyyyy, header is 112 bytes of pure ecstasy
This commit is contained in:
+8
-2
@@ -45,8 +45,8 @@ func (tb headerBuf) musttoken(slice headerSlice) []byte {
|
||||
}
|
||||
|
||||
func (tb headerBuf) slice(b []byte) headerSlice {
|
||||
base := uintptr(unsafe.Pointer(&tb.buf[0]))
|
||||
off := uintptr(unsafe.Pointer(&b[0]))
|
||||
base := uintptr(unsafe.Pointer(unsafe.SliceData(tb.buf)))
|
||||
off := uintptr(unsafe.Pointer(unsafe.SliceData(b)))
|
||||
if off < base || off > base+uintptr(len(tb.buf)) {
|
||||
panic("httpx: argument buffer does not alias header buffer")
|
||||
}
|
||||
@@ -87,6 +87,12 @@ type header struct {
|
||||
flags flags
|
||||
}
|
||||
|
||||
func (h *header) ParseBytes(b []byte) error {
|
||||
h.resetSkipNormalize()
|
||||
h.hbuf.readFromBytes(b)
|
||||
return h.parse()
|
||||
}
|
||||
|
||||
func (h *header) Set(key, value string) {
|
||||
h.SetCanonical(key, value) //TODO: implement non-canonical.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user