go-rfc2616/sp/rune_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
// RuneIsTolerant is a more tolerant version of RuneIs.
// Where RuneIs only returns whether the rune 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
// RuneIsTolerant 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 RuneIsTolerant(value rune) bool {
2023-12-06 15:58:29 +00:00
return ' ' == value || '\t' == value
}