lucid-shopify 0.55.0 → 0.56.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lucid/shopify/parse_link_header.rb +18 -1
- data/lib/lucid/shopify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: addb963ec9b838bc5039979f8701a1b640158b8627ee5b2589729dbcc16954ec
|
4
|
+
data.tar.gz: ec5af11336d7b0c5fcfbe139884fd4c1afc6cd8ebc17f12ea2c25f6b18323962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|