rack-empty-body-fix 0.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.
- checksums.yaml +7 -0
- data/lib/rack_empty_body_fix.rb +25 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4b68dfc8c4cb8ecdf13f7af83228bb3f0e92af54
|
4
|
+
data.tar.gz: 8696cee14aa37a864c626ce8c9577874d17ee23b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 11d47a70f8b50d60dea84ce172f4ba58f1fb097783810f017fd19fb1fd4e125b5c15bc0f442bebc640cd197d9f4fcdea089ef003aabd604c70f4532531e57a7f
|
7
|
+
data.tar.gz: 794ac477c20dea716b9174af3438c95c69895496d3a597d984bfd088dc72de7e4409a17e57bcfae846e7de5e4035032ba7c2e06d4d10fae3f92b0bc1149e2b1e
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Rack Empty Post Body Fix
|
2
|
+
#
|
3
|
+
# This class is a Rack Middleware that checks for
|
4
|
+
# an empty POST body (an MSIE issue, naturally)
|
5
|
+
# and errors out if found.
|
6
|
+
class RackEmptyBodyFix
|
7
|
+
def initialize(app)
|
8
|
+
@app = app
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
if env['POST_BODY']
|
13
|
+
body = env['POST_BODY'].read
|
14
|
+
|
15
|
+
if body && body.empty?
|
16
|
+
return [408, { 'Content-Type' => 'text/plain' }, ['empty body']]
|
17
|
+
end
|
18
|
+
|
19
|
+
env['POST_BODY'].rewind
|
20
|
+
end
|
21
|
+
|
22
|
+
@app.call env
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rack-empty-body-fix
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Randy Carnahan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Rack Middleware to fix MSIE empty POST body issue.
|
14
|
+
email: syntruth@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/rack_empty_body_fix.rb
|
20
|
+
homepage: https://github.com/syntruth/rack-empty-body-fix
|
21
|
+
licenses:
|
22
|
+
- GPL
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.2.2
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Fix for MSIE empty POST body issue.
|
44
|
+
test_files: []
|