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
Hey guys,
I'm trying to paginate an API, with the latest release(2.1.4)and the links generated by pagy_headers_hash are incorrect. Doing a GET request to http://localhost:3000/items.json?page=2 I expected pagy_headers_hash to return:
@r-sierra Yes, that's a bug, and, as you find-out, it is due to an improper use of request.url.
I forgot to add tests to check the full url when I pushed the headers extra. Adding better tests exposed also another missing thing: the items extra overrides the pagy_url_for but it used the old pagy_url_for implementation, so that has been fixed as well now.
Hey guys,
I'm trying to paginate an API, with the latest release(
2.1.4
)and the links generated bypagy_headers_hash
are incorrect. Doing a GET request tohttp://localhost:3000/items.json?page=2
I expectedpagy_headers_hash
to return:but instead got:
After reading the code it seems that the problem is around this line:
pagy/lib/pagy/extras/headers.rb
Line 26 in 95cdf61
which calls:
pagy/lib/pagy/frontend.rb
Line 17 in 95cdf61
And
request.send(:url)
will return the full URL with its query string according to Rack documentation. Hence the double parameters.Please let me know if you need any additional information.
Excellent work by the way! Awesome gem,
Thanks
The text was updated successfully, but these errors were encountered: