You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to generate a PDF containing a signed link. The signature strings contains characters that need to be URL encoded for use in the query parameters, e.g. "wJ7OAi7u3WSJtzEq0b+xaoEG9yY=". So my entire (encoded) link should be something like: https://www.google.com?signature=wJ7OAi7u3WSJtzEq0b%2BxaoEG9yY%3D (non-sense link of course, just for illustration purposes).
Now, if I render this link using text with inline_format the resulting link will have the percent-characters in the already encoded string encoded again, resulting in this invalid link: https://www.google.com?signature=wJ7OAi7u3WSJtzEq0b%252BxaoEG9yY%253D
However, if I pass the un-encoded URL, i.e. https://www.google.com?signature=wJ7OAi7u3WSJtzEq0b+xaoEG9yY=, no URL-escaping is happening at all, which also gives me a broken link, because the + is interpreted as a space.
Here's some sample code to reproduce the behaviour:
So the escaped URL gets inserted. And when I open the PDF in Evince and click on the link I get directed to https://www.google.com/?signature=wJ7OAi7u3WSJtzEq0b%2BxaoEG9yY%3D.
I'm trying to generate a PDF containing a signed link. The signature strings contains characters that need to be URL encoded for use in the query parameters, e.g. "wJ7OAi7u3WSJtzEq0b+xaoEG9yY=". So my entire (encoded) link should be something like:
https://www.google.com?signature=wJ7OAi7u3WSJtzEq0b%2BxaoEG9yY%3D
(non-sense link of course, just for illustration purposes).Now, if I render this link using
text
withinline_format
the resulting link will have the percent-characters in the already encoded string encoded again, resulting in this invalid link:https://www.google.com?signature=wJ7OAi7u3WSJtzEq0b%252BxaoEG9yY%253D
However, if I pass the un-encoded URL, i.e.
https://www.google.com?signature=wJ7OAi7u3WSJtzEq0b+xaoEG9yY=
, no URL-escaping is happening at all, which also gives me a broken link, because the+
is interpreted as a space.Here's some sample code to reproduce the behaviour:
Why is the %-character seemingly escaped by prawn, but nothing else? Is this a legit bug or am I not using this method correctly?
The text was updated successfully, but these errors were encountered: