Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
New constants for a header parts validation
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Dec 7, 2018
1 parent a91c73f commit e06dd1f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/HeaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@
interface HeaderInterface
{

/**
* Regular Expression for a token validation
*
* @link https://tools.ietf.org/html/rfc7230#section-3.2
*/
public const RFC7230_TOKEN = '/^[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]+$/';

/**
* Regular Expression for a field-value validation
*
* @link https://tools.ietf.org/html/rfc7230#section-3.2
*/
public const RFC7230_FIELD_VALUE = '/^[\x09\x20-\x7E\x80-\xFF]*$/';

/**
* Regular Expression for a quoted-string validation
*
* @link https://tools.ietf.org/html/rfc7230#section-3.2
*/
public const RFC7230_QUOTED_STRING = '/^[\x09\x20\x21\x23-\x5B\x5D-\x7E\x80-\xFF]*$/';

/**
* Gets the header field-name
*
Expand Down

0 comments on commit e06dd1f

Please sign in to comment.