symfony/symfony — pull request #9803 by lucasmichot (2013-12-17 16:55:52+00:00)
Title: [HttpFoundation] [Response] Precondition Failed

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26

This feature adds the counterpart functions of `isNotModified()` and `setNotModified()`.
When a Request header ETag is provided and doesn't match the Response header Etag
AND/OR
When a Request header If-Modified-Since is provided and doesn't match the Response header Last-Modified

This allows to comply to RFC2616 specifications (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26).

This feature comes with the two following functions:
```php
hasPreconditionFailed()
setPreconditionFailed()
```

This might ease up conditional response management, especially when using this feature within a REST server.