Skip to content

Conversation

@jweisman
Copy link
Contributor

Hi there. Great little script. Thanks for it.

We've added a configuration option to suppress the Expect: 100-continue header which CURL adds automatically but which is not handled correctly by some web servers. Would be grateful if you'd consider merging this into master.

Thanks!

PHP (7.1.16) was showing `Content-Type` and `Content-Length` with both their original name and preceded by `HTTP`:
```
CONTENT_TYPE
HTTP_CONTENT_TYPE
CONTENT_LENGTH
HTTP_CONTENT_LENGTH
```

This was causing the headers to be added as duplicates in the request_headers array. Removing the 'CONTENT' condition to prevent the duplicate addition.
Remove the `Expect` header which is [not handled](https://blog.pilif.me/2007/02/02/the-return-of-except-100-continue/) by many hosts (including the API gateway apparently).
Restore CONTENT headers- it seems that from some clients PHP doesn't have the duplicate headers. Consider adding an `array_unique` to clean header array

Wrap handling of Expect header in config variable.
@softius softius merged commit be37139 into softius:master Sep 21, 2018
@softius
Copy link
Owner

softius commented Sep 21, 2018

Thank you @jweisman for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants