Document HTTP request snippet’s special treatment of the Host header
For an HTTP 1.1 request to be valid it must contain a Host header. To ensure that the HTTP request snippet is a valid HTTP 1.1 request a Host header will always be included. If one is not present in the request that’s being documented, the snippet will generate one automatically. A side-effect of this is that a preprocessor that removes the Host header will have no effect on the HTTP request snippet. This commit updates the documentation to describe this behaviour. Closes gh-134
This commit is contained in:
@@ -77,6 +77,10 @@ different replacement can also be specified if you wish.
|
||||
`removeHeaders` on `Preprocessors` removes any occurrences of the named headers
|
||||
from the request or response.
|
||||
|
||||
NOTE: For an HTTP 1.1 request to be valid it must contain a `Host` header. Therefore,
|
||||
irrespective of any preprocessing, the default HTTP request snippet will always contain a
|
||||
`Host` header.
|
||||
|
||||
|
||||
|
||||
[[customizing-requests-and-responses-preprocessors-replace-patterns]]
|
||||
|
||||
@@ -388,7 +388,8 @@ call that is being documented
|
||||
|
||||
| `http-request.adoc`
|
||||
| Contains the HTTP request that is equivalent to the `MockMvc` call that is being
|
||||
documented
|
||||
documented. HTTP 1.1 requires a `Host` header. If you do not provide one via the
|
||||
`MockMvc` API the snippet will add one automatically.
|
||||
|
||||
| `http-response.adoc`
|
||||
| Contains the HTTP response that was returned
|
||||
|
||||
Reference in New Issue
Block a user