-
Notifications
You must be signed in to change notification settings - Fork 89
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
truncate crash log string to 60000 characters #84
Conversation
Airbrake/notifier/ABNotifier.m
Outdated
// chrash reports seems to be limited to 64kb, otherwise they are ignored by the API with the following error | ||
// [Airbrake] {"code":400,"type":"Bad Request","message":"http: request body too large"} | ||
// so we truncate the string to 60000 characters | ||
if(dataStr.length > 60000) { |
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.
- Our API limit is 64KB, not 60000 characters, hence this is not the most precise check
- Looks like you truncate a string. We need to check dumped JSON if it's bigger than 64KB and then truncate payload in the notice object
@kyrylo Thats true this check was not very precise. I now first create the JSON, check the size and if it is too large i truncate the payload string |
This looks good to me. My only concern is that the size limit is hardcoded in the API. |
@jocelynlih that's a correct assumption. We hardcode this in every notifier that supports this feature. |
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.
Looks good to me.
Thanks, @juergenm! |
@kyrylo thanks for merging, could you please release a new version so that I can use it with CocoaPods. |
to fix "Request body to large" error. fixes #82