Rfc7230.php 665 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. namespace GuzzleHttp\Psr7;
  4. /**
  5. * @internal
  6. */
  7. final class Rfc7230
  8. {
  9. /**
  10. * Header related regular expressions (based on amphp/http package)
  11. *
  12. * Note: header delimiter (\r\n) is modified to \r?\n to accept line feed only delimiters for BC reasons.
  13. *
  14. * @link https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15
  15. *
  16. * @license https://github.com/amphp/http/blob/v1.0.1/LICENSE
  17. */
  18. public const HEADER_REGEX = "(^([^()<>@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
  19. public const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)";
  20. }