architect-functions 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/architect/http.rb +10 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fd93af51e2f218a943260b1e957a45a48b5e328bc93c92b627105be932dc312
4
- data.tar.gz: 511eb89cc745baafa7f240eea714f7cbde3b3038efb3f514376850861f88d346
3
+ metadata.gz: 90fc901dc181df1e27cbe945f8e45f90606d845a840ee17fd9259b93715ca183
4
+ data.tar.gz: da52f1a06eb67d04e7f98b9c4eacb2197ecf4038a5b35c9d2f5b13083b1fea7b
5
5
  SHA512:
6
- metadata.gz: 932bb9a2571cf7a97311a2c57cc9d43220d3cd3453bcd95bb23460614110324ffbba634510c9cf52ecb18540c7d39ac12f7a60a2c5b78c7af68ca7c486709501
7
- data.tar.gz: ae8a2fd3b4238a69f6117552efe4f1a1dacf492259b5baaf143cb7c07f9efdace49172ac6b7adea0efa7f906cdb1d7870522578916daf6849c74c4b38a663f4b
6
+ metadata.gz: 56440f59753103367e133dd7e8ad823c525792a5f5a486000e85e8f2b67642083cf496ac797c412963ff9025af696872773eed71eebbfd4171f25c16f2c71129
7
+ data.tar.gz: 86c22be3b8a70b876ccec4ff7f88880ef0810ec594aece098977a08e85db62a760fa58daf1c047390508a5441ece4cc4062a79c819842f2da11580dba60c0803
@@ -8,11 +8,18 @@ module Arc
8
8
 
9
9
  def self.read(request)
10
10
 
11
- # look for the headers and return if theres nothing
12
- raw = request[:event]['headers']['cookie'] || false
11
+ # ruby is awesome; hash keys might be strings or symbols
12
+ tmp = if request[:event].has_key? :headers then
13
+ request[:event][:headers]
14
+ else
15
+ request[:event]['headers']
16
+ end
17
+
18
+ # continue our cookie search
19
+ raw = tmp['cookie'] || tmp[:cookie] || false
13
20
  return {} if raw == false
14
21
 
15
- # if we found cookie parse it; bail if _idx is missing
22
+ # if we found the cookie parse it; bail if _idx is missing
16
23
  parsed = raw.split(/=|;/).collect(&:strip)
17
24
  return {} unless parsed.include? '_idx'
18
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: architect-functions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian LeRoux