Following on to #112 -- it seems like the same code:
links[page_name] = original_url + CGI.unescape(
original_params.to_query
)
is having the (maybe?) unintended consequence of unescaping previously escaped parameters. Say I have a Rails route returning JSON:API, with a request URL like so:
http://example.test/resources?filter[genre_form]=Advertising+cards
When I include JSONAPI::Pagination in my controller, I get this links block:
"links": {
"self": "http://example.test/resources?filter[genre_form]=Advertising+cards",
"current": "http://example.test/resources?filter[genre_form]=Advertising cards&page[number]=1"
}
The page number has been appended, which is good; the +-encoded space in filter[genre_form]=Advertising+cards has been decoded, which seems sketchy.
As with #112, maybe I'm just missing something about the design intent here, but I'd expect the original query to stay intact, and just have the page params set.
Following on to #112 -- it seems like the same code:
is having the (maybe?) unintended consequence of unescaping previously escaped parameters. Say I have a Rails route returning JSON:API, with a request URL like so:
When I include
JSONAPI::Paginationin my controller, I get thislinksblock:The page number has been appended, which is good; the
+-encoded space infilter[genre_form]=Advertising+cardshas been decoded, which seems sketchy.As with #112, maybe I'm just missing something about the design intent here, but I'd expect the original query to stay intact, and just have the page params set.