Skip to content

Commit

Permalink
Improve documentation with a motivation section
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Nov 16, 2024
1 parent 8cff8e4 commit 1c229ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/00-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ $field[1]->value()->toString(); // returns 'application/xhtml+xml'
$field[1]->parameterByKey(key: 'q', default: 1.0); // returns 1.0 if the parameter is not defined
```

## Motivation

While they are plenty of HTTP headers and trailers, they have historically come each with their own set of
rules and constraints when it came to parsing and serializing them. Trying to use the parsing logic of a cookie header
to parse an accept header will fail. The various parsing logics hinders HTTP headers usage, modernization or security
to name but a few issues with multitude abd disparate parsing logics. The [Structured Field RFC](https://www.rfc-editor.org/rfc/rfc9651.html)
aim at tackling those issues by unifying HTTP headers and trailers.

New HTTP header or trailer is encouraged to use the RFC algorithm and ongoing discussions are happening to [retrofit existing
headers that do not match the RFC](https://httpwg.org/http-extensions/draft-ietf-httpbis-retrofit.html) into new
shape that would be compatible with it.

## Foreword

> [!CAUTION]
Expand Down
2 changes: 1 addition & 1 deletion docs/04-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is the structure from which you will be able to access the actual field con

## Items value

The height (8) defined value types are all attached to an `Item` object where their value and
The eight (8) defined value types are all attached to an `Item` object where their value and
type are accessible using the following methods:

```php
Expand Down

0 comments on commit 1c229ac

Please sign in to comment.