Skip to content

Commit

Permalink
Fix get_previous_page_url and get_next_page_url
Browse files Browse the repository at this point in the history
  • Loading branch information
pristupa committed Apr 2, 2024
1 parent e84c912 commit 04026e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [20.0.1] - 2024-04-02
### Bugfixes
- get_previous_page_url and get_next_page_url fixed

## [20.0.0] - 2024-04-01
### Bugfixes
- Vulnerability fix: remove the X-Forwarded-Host/X-Host header values from next/previous page links in Page response
Expand Down
4 changes: 2 additions & 2 deletions winter/web/pagination/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_previous_page_url(page: Page, request: django.http.HttpRequest) -> Optio
if not offset or limit is None:
return None

url = furl(request.path)
url = furl(request.get_full_path())
url.query.set([('limit', limit)])

previous_offset = offset - limit
Expand All @@ -39,7 +39,7 @@ def get_next_page_url(page: Page, request: django.http.HttpRequest) -> Optional[
if next_offset >= total:
return None

url = furl(request.path)
url = furl(request.get_full_path())
url.query.set([
('limit', limit),
('offset', next_offset),
Expand Down

0 comments on commit 04026e8

Please sign in to comment.