-
Notifications
You must be signed in to change notification settings - Fork 769
Description
Describe the bug
When we invoke commit() with content length > 57
The API fails with 422, invalid Base 64 encoding
If we have a content 1234567890123456789012345678901234567890123456789012345678 of length 58.
Base64 encoding is
MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3OA==
MIME encoding looks like
MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3
OA==
MIME encoding breaks the string into chunks of 76. This is rejected by Github API
This could be due to the recent change ?
https://github.com/github-api/github-api/blob/d1507f26668950508e0bf242c34cdb599003991a/src/main/java/org/kohsuke/github/GHContentBuilder.java#L71
To Reproduce
Steps to reproduce the behavior:
Invoke the method with content of length >57
Expected behavior
The commit must be successful
Desktop (please complete the following information):
1.102-SNAPSHOT
Additional context
I was able to fix this issue locally by using Base64.getEncoder().encodeToString()