From 04026e80542806c0f0f4c8290d27c57148e5f05a Mon Sep 17 00:00:00 2001 From: "Pavel V. Pristupa" Date: Tue, 2 Apr 2024 05:28:22 +0200 Subject: [PATCH] Fix get_previous_page_url and get_next_page_url --- CHANGELOG.md | 4 ++++ winter/web/pagination/utils.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70eb0077..363df5c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/winter/web/pagination/utils.py b/winter/web/pagination/utils.py index d4b260e4..75854302 100644 --- a/winter/web/pagination/utils.py +++ b/winter/web/pagination/utils.py @@ -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 @@ -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),