lucid-shopify 0.55.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44bfabaa371fa86d7e8e5510a48c06e4736185ec34fbc2f3317ed0666ba8e2fe
4
- data.tar.gz: 78b86372b571b91c30b7894f8df2e74fec8b9f505d0c5f148e65ebf123a61150
3
+ metadata.gz: addb963ec9b838bc5039979f8701a1b640158b8627ee5b2589729dbcc16954ec
4
+ data.tar.gz: ec5af11336d7b0c5fcfbe139884fd4c1afc6cd8ebc17f12ea2c25f6b18323962
5
5
  SHA512:
6
- metadata.gz: 76bfe8211440ed42b34782aaafc4b191d6c6bc34fccc3daf9f3bbd18481c7d11fbcdb70a6c54f7e58c507c4949ad325f08bd85ff53367385a04b5221fc7fc33c
7
- data.tar.gz: fac21c77880396f5a5f53ac695b56ce2e0394688367e8235c243427ed784ddb0e2d0a8d3a8c4d1089d42426ae83582fe0e5fa5d09d495116ae93144ee364301d
6
+ metadata.gz: 6fc1a8d5d0098a0fcab038dfec589aa8c97968c6258c53049499bd1cb4e32476e279b86928de3ae7994e59193062897447faf3f84d1cc73cd76cb7b7886e73b8
7
+ data.tar.gz: 0e0fd6dc44b37064ba6758d23d5662cce0c2cade91496e00c6eb20db1c5aa0564c168797d1a63eb5bfffc8253ef725dc80f0700f2ed40dea315b4acd91abe389
@@ -12,7 +12,24 @@ module Lucid
12
12
  #
13
13
  # @return [Hash]
14
14
  def call(link_header)
15
- return {} if link_header.nil?
15
+ case link_header
16
+ # NOTE: There is a strange behaviour where it seems that if the header
17
+ # value exceeds a certain length, it is split into chunks. It seems that
18
+ # if you use {HTTP::Headers#get}, you will always get {Array<String},
19
+ # and it is the special behaviour of {HTTP::Headers#[]} causing this.
20
+ #
21
+ # However, why is it split in the first place? Does Shopify send
22
+ # multiple Link headers (as chunks) for longer values? There does not
23
+ # seem to be any limit on the length of value in the HTTP specification.
24
+ #
25
+ # https://www.rubydoc.info/gems/http/HTTP/Headers#[]-instance_method
26
+ # https://www.rubydoc.info/gems/http/HTTP/Headers#get-instance_method
27
+ when Array
28
+ link_header = link_header.join
29
+ when String
30
+ else
31
+ return {}
32
+ end
16
33
 
17
34
  link_header.split(',').map do |link|
18
35
  url, rel = link.split(';') # rel should be the first param
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lucid
4
4
  module Shopify
5
- VERSION = '0.55.0'
5
+ VERSION = '0.56.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid-shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.55.0
4
+ version: 0.56.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-14 00:00:00.000000000 Z
11
+ date: 2020-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv