limit label and message to 255 chars #10998
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we don't place any limit on the size of a label or message
This means you can make badges with really long text, for example:
That is not particularly useful. With the dyanmic and endpoint badges you can construct relatively small requests that force us to render a single SVG containing up to about 10Mb of text (the largest response size we will accept from an upstream URL). Here's a less extreme example that proves the concept:
In this PR, I propose imposing a limit on the size of the message and label fields we will render. 255 characters seems like more than enough to render all useful badges.
I've done this in shields.io core rather than badge-maker. Badge-maker library users can render any length of text