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.
This pull request adds a new 'pretty' recipe configuration format so that URLs are slightly more readable.
The current recipe format is simply serialised JSON. A contrived example with three random operations looks like this:
When added to the URL, this has to be percent-encoded and ends up as this mess:
#recipe=%5B%7B%22op%22%3A%22From%20Hex%22%2C%22args%22%3A%5B%22Space%22%5D%7D%2C%7B%22op%22%3A%22Pad%20lines%22%2C%22args%22%3A%5B%22Start%22%2C%225%22%2C%22%20%22%5D%7D%2C%7B%22op%22%3A%22Strings%22%2C%22args%22%3A%5B%223%22%2Cfalse%5D%7D%5D
Needless to say, this isn't particularly readable. The new format attempts to be as compact as possible, whilst improving readability. It relies on various special characters that do not need to be escaped in the fragment (#) or query (?) parts of a URL, as defined in RFC 3986. The above example looks like this in the new format:
When it is used in the URL, newlines are removed and only characters which need to be escaped are percent-encoded:
This saves space and hopefully looks a little less confusing. Complex CyberChef recipes can now be shared without the link looking quite as much like an XSS attempt...
Backwards compatibility with the serialised JSON recipe format has been maintained so old links will still work.