go-rfc2616/sp/byte_tolerant.go

14 lines
374 B
Go
Raw Normal View History

2023-12-06 15:58:29 +00:00
package sp
2023-12-08 20:59:32 +00:00
// ByteIsTolerant is a more tolerant version of ByteIs.
// Where ByteIs only returns whether the byte is a 'SP' (spacing) character, as defined by IETF RFC-2616:
2023-12-06 15:58:29 +00:00
//
// SP = <US-ASCII SP, space (32)>
//
2023-12-08 20:59:32 +00:00
// ByteIsTolerant also allows:
2023-12-06 15:58:29 +00:00
//
// HT = <US-ASCII HT, horizontal-tab (9)>
2023-12-08 20:59:32 +00:00
func ByteIsTolerant(value byte) bool {
2023-12-06 15:58:29 +00:00
return ' ' == value || '\t' == value
}