akamai-edgegrid 1.0 → 1.0.1

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.
Files changed (2) hide show
  1. data/lib/akamai/edgegrid.rb +6 -3
  2. metadata +2 -2
@@ -101,11 +101,14 @@ module Akamai #:nodoc:
101
101
  # Returns a hash of the HTTP POST body
102
102
  def make_content_hash(request)
103
103
  if request.method == 'POST' and request.body_exist? and request.body.length > 0
104
- if request.body.length > @max_body
105
- raise "body is too large. max_body=#{@max_body}"
104
+ body = request.body
105
+ if body.length > @max_body
106
+ @log.debug("data length #{body.length} is larger than maximum #{@max_body}")
107
+ body = body[0..@max_body-1]
108
+ @log.debug("data truncated to #{body.length} for computing the hash")
106
109
  end
107
110
 
108
- return self.class.base64_sha256(request.body)
111
+ return self.class.base64_sha256(body)
109
112
  end
110
113
  return ""
111
114
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: akamai-edgegrid
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-27 00:00:00.000000000 Z
12
+ date: 2014-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov