Skip to content

Fix fatal error for long bodies #116

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

Merged
merged 3 commits into from
Aug 4, 2019
Merged

Fix fatal error for long bodies #116

merged 3 commits into from
Aug 4, 2019

Conversation

GaryPEGEOT
Copy link
Contributor

@GaryPEGEOT GaryPEGEOT commented Aug 2, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #93
Documentation
License MIT

What's in this PR?

Prevent CurlCommandFormatter to throw a Fatal exception when body size exceed escapeshellarg argument allowed length. Didn't find a great way to get the limit tho... Windows limit come from PHP source code, the UNIX from

echo $(getconf ARG_MAX)

If you have a better solution to find escapeshellarg limit, I'm all ears

Checklist

  • Updated CHANGELOG.md to describe bugfix

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for looking into this!

i wonder if it even makes sense to output more than 8K of body - it will be hard to copy-paste and might explode things like the symfony debug panel. i feel that people would want to log larger bodies to some file if they need to debug something. maybe lets just limit to 8192 and say that this should work on all operating systems. wdyt?

@GaryPEGEOT
Copy link
Contributor Author

maybe lets just limit to 8192 and say that this should work on all operating systems. wdyt?

Totally agree, it's neither user friendly nor memory friendly

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. suggestion to tweak the commend. @php-http/httplug do you agree with this change or do you see any issue?

@dbu
Copy link
Contributor

dbu commented Aug 4, 2019

thanks!

@dbu dbu merged commit 8002fae into php-http:master Aug 4, 2019
@dbu
Copy link
Contributor

dbu commented Aug 5, 2019

released 1.8.0 with this and some other fixes.

ArthurJam pushed a commit to ArthurJam/message that referenced this pull request Oct 19, 2021
* Fix fatal error for long bodies

* Set body size limit to 8192

* Phrasing
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.

CurlFormatter fails on large boddies
2 participants