-
Notifications
You must be signed in to change notification settings - Fork 56
Add a warning about missing headers on the request #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.. warning:: | ||
|
||
This client assume that the request is compliant with HTTP 2.0, 1.1 or 1.0 standard. So a request without a ``Host`` header, or | ||
with a body but wihout a ``Content-Length`` will certainly fail. You can make sure that requests used by this client are valid, by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/wihout/without/
8be844c
to
eec920b
Compare
@@ -63,4 +63,10 @@ use case would be:: | |||
]; | |||
$client = new Client($messageFactory, $options); | |||
|
|||
.. warning:: | |||
|
|||
This client assume that the request is compliant with HTTP 2.0, 1.1 or 1.0 standard. So a request without a ``Host`` header, or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This client assumes" (s at the end)
is this specific to the socket client? do curl client and guzzle adapter (resp. guzzle) handle that automatically? |
I think they do (but not sure) |
Guzzle is handling it automatically. |
decorating it with :doc:`plugins </plugins/introduction>` like ``ContentLengthPlugin`` or ``HeaderDefaultsPlugin``. | ||
This client assumes that the request is compliant with HTTP 2.0, 1.1 or 1.0 standard. So a request without a ``Host`` header, or | ||
with a body but without a ``Content-Length`` will certainly fail. | ||
If you don't trust incoming requests, we heavily recommend you to use the ``PluginClient`` with the following plugins: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incoming requests sounds strange for a client. i would say: "To make sure all requests will be sent out correctly, we recommend to use ...
61df3ee
to
f489ef5
Compare
|
||
* ``ContentLengthPlugin`` sets the correct ``Content-Length`` header, or decorate the stream to use chunked encoding | ||
* ``DecoderPlugin`` decodes encoding coming from the response (chunked, gzip, deflate and compress) | ||
* ``HeaderDefaultsPlugin`` sets default headers values if not present (like for the ``Host`` header) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erm. HeaderDefaultsHeader just accepts default values for headers. and AddHostPlugin is about adding host (and scheme and port) to a path if the request is only for a path.
it sounds like we should come up with a new plugin SetHostHeaderFromUriPlugin or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SetHostHeaderFromUriPlugin
i believe it's already handle by the implementation as there is a long description on setting host and request target url on the PSR7 standard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay. so we can drop this line?
ping @joelwurtz |
Is this still a thing? |
f489ef5
to
eb1329c
Compare
eb1329c
to
4923f5c
Compare
Yes, it should be good now |
No description provided.