From bf3fc9149072dae77bbaad6323c0df494036d488 Mon Sep 17 00:00:00 2001 From: FORSBERG+two Date: Thu, 7 May 2020 19:38:12 +0200 Subject: [PATCH] Fixes #713 - Use relative_uri when parsing link headers for pagination Fixes #713 - Use relative_uri when parsing link headers for pagination Update version and changelog --- CHANGELOG.md | 4 ++++ lib/shopify_api/pagination_link_headers.rb | 2 +- lib/shopify_api/version.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9dc9e61c..0189f854c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Version 9.1.1 + +* Make cursor based pagination return relative uri's when fetching next and previous pages. [#726](https://github.com/Shopify/shopify_api/pull/726) + ## Version 9.1.0 * Implements equality operator on `Session` [#714](https://github.com/Shopify/shopify_api/pull/714) diff --git a/lib/shopify_api/pagination_link_headers.rb b/lib/shopify_api/pagination_link_headers.rb index dd4c35a2d..1400467c0 100644 --- a/lib/shopify_api/pagination_link_headers.rb +++ b/lib/shopify_api/pagination_link_headers.rb @@ -25,7 +25,7 @@ def parse_link_header(link_header) url = parts[0][/<(.*)>/, 1] rel = parts[1][/rel="(.*)"/, 1]&.to_sym - url = URI.parse(url) + url = URI.parse(url).request_uri LinkHeader.new(url, rel) end end diff --git a/lib/shopify_api/version.rb b/lib/shopify_api/version.rb index f46924f6f..e78ee542a 100644 --- a/lib/shopify_api/version.rb +++ b/lib/shopify_api/version.rb @@ -1,3 +1,3 @@ module ShopifyAPI - VERSION = "9.1.0" + VERSION = "9.1.1" end