diff options
Diffstat (limited to 'libgo/go/net/http/lex.go')
-rw-r--r-- | libgo/go/net/http/lex.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libgo/go/net/http/lex.go b/libgo/go/net/http/lex.go index 50b14f8..52b6481 100644 --- a/libgo/go/net/http/lex.go +++ b/libgo/go/net/http/lex.go @@ -167,3 +167,17 @@ func tokenEqual(t1, t2 string) bool { } return true } + +// isLWS reports whether b is linear white space, according +// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 +// LWS = [CRLF] 1*( SP | HT ) +func isLWS(b byte) bool { return b == ' ' || b == '\t' } + +// isCTL reports whether b is a control byte, according +// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 +// CTL = <any US-ASCII control character +// (octets 0 - 31) and DEL (127)> +func isCTL(b byte) bool { + const del = 0x7f // a CTL + return b < ' ' || b == del +} |