puma 2.15.1 → 2.15.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d4fcaf235b9f9fe96d11414de74d15922efab03
4
- data.tar.gz: 0ccf633cd692e33c72e7dfe246454a015a616b6b
3
+ metadata.gz: 1173eb40e9b144235b309616535fe6bec2e2b782
4
+ data.tar.gz: d70686709d9be7b38eb308dd1ee423dfda95cdda
5
5
  SHA512:
6
- metadata.gz: 4e14fd8cba285087bbedfe5c1a80394d7dc2e0a9c33e33d7f49d9ee07f220a86579bb6e8feee4f472ce13fcf24fe778fd2311cfbcfa733d35238292ba2d29963
7
- data.tar.gz: ba7217636b273910aecabeb521209ebebff2024d132c54f40cbfc600fef143e6b0539e0ed98d49f2a062667c63e17c5f65bc2483cd62ab780557d767544f36a3
6
+ metadata.gz: 67548e119a3b36cb2bf6584019534d022c7b15078f937ee4e8c9fcaa550c2b7c3780b70c4d6d05f781321d174f39ced057dacf1d438452ccbcb531a52377146d
7
+ data.tar.gz: 7e444777b053f067ef7e1c44c1063aa18ffa753e21adad669851328eac037cebe6b4dc9b8bcf43e84cf3b7ec839cc6191cada672eafcf1ce212e709e0568540f
@@ -1,3 +1,13 @@
1
+ === 2.15.2 / 2015-11-06
2
+
3
+ * 2 bug fixes:
4
+ * ext/puma_http11: handle duplicate headers as per RFC
5
+ * Only set ctx.ca iff there is a params['ca'] to set with.
6
+
7
+ * 2 PRs merged:
8
+ * Merge pull request #818 from unleashed/support-duplicate-headers
9
+ * Merge pull request #819 from VictorLowther/fix-ca-and-verify_null-exception
10
+
1
11
  === 2.15.1 / 2015-11-06
2
12
 
3
13
  * 1 bug fix:
@@ -82,11 +82,11 @@ public class Http11 extends RubyObject {
82
82
  private Http11Parser.FieldCB http_field = new Http11Parser.FieldCB() {
83
83
  public void call(Object data, int field, int flen, int value, int vlen) {
84
84
  RubyHash req = (RubyHash)data;
85
- RubyString v,f;
85
+ RubyString f;
86
+ IRubyObject v;
86
87
  validateMaxLength(flen, MAX_FIELD_NAME_LENGTH, MAX_FIELD_NAME_LENGTH_ERR);
87
88
  validateMaxLength(vlen, MAX_FIELD_VALUE_LENGTH, MAX_FIELD_VALUE_LENGTH_ERR);
88
89
 
89
- v = RubyString.newString(runtime, new ByteList(Http11.this.hp.parser.buffer,value,vlen));
90
90
  ByteList b = new ByteList(Http11.this.hp.parser.buffer,field,flen);
91
91
  for(int i = 0,j = b.length();i<j;i++) {
92
92
  if((b.get(i) & 0xFF) == '-') {
@@ -104,7 +104,16 @@ public class Http11 extends RubyObject {
104
104
  f = RubyString.newString(runtime, "HTTP_");
105
105
  f.cat(b);
106
106
  }
107
- req.op_aset(req.getRuntime().getCurrentContext(), f,v);
107
+
108
+ b = new ByteList(Http11.this.hp.parser.buffer, value, vlen);
109
+ v = req.op_aref(req.getRuntime().getCurrentContext(), f);
110
+ if (v.isNil()) {
111
+ req.op_aset(req.getRuntime().getCurrentContext(), f, RubyString.newString(runtime, b));
112
+ } else {
113
+ RubyString vs = v.convertToString();
114
+ vs.cat(", ");
115
+ vs.cat(b);
116
+ }
108
117
  }
109
118
  };
110
119
 
@@ -176,14 +176,12 @@ static VALUE find_common_field_value(const char *field, size_t flen)
176
176
  void http_field(puma_parser* hp, const char *field, size_t flen,
177
177
  const char *value, size_t vlen)
178
178
  {
179
- VALUE v = Qnil;
180
179
  VALUE f = Qnil;
180
+ VALUE v;
181
181
 
182
182
  VALIDATE_MAX_LENGTH(flen, FIELD_NAME);
183
183
  VALIDATE_MAX_LENGTH(vlen, FIELD_VALUE);
184
184
 
185
- v = rb_str_new(value, vlen);
186
-
187
185
  f = find_common_field_value(field, flen);
188
186
 
189
187
  if (f == Qnil) {
@@ -201,7 +199,17 @@ void http_field(puma_parser* hp, const char *field, size_t flen,
201
199
  f = rb_str_new(hp->buf, new_size);
202
200
  }
203
201
 
204
- rb_hash_aset(hp->request, f, v);
202
+ /* check for duplicate header */
203
+ v = rb_hash_aref(hp->request, f);
204
+
205
+ if (v == Qnil) {
206
+ v = rb_str_new(value, vlen);
207
+ rb_hash_aset(hp->request, f, v);
208
+ } else {
209
+ /* if duplicate header, normalize to comma-separated values */
210
+ rb_str_cat2(v, ", ");
211
+ rb_str_cat(v, value, vlen);
212
+ }
205
213
  }
206
214
 
207
215
  void request_method(puma_parser* hp, const char *at, size_t length)
@@ -166,7 +166,7 @@ module Puma
166
166
  end
167
167
  end
168
168
 
169
- ctx.ca = params['ca']
169
+ ctx.ca = params['ca'] if params['ca']
170
170
 
171
171
  if params['verify_mode']
172
172
  ctx.verify_mode = case params['verify_mode']
@@ -99,7 +99,7 @@ module Puma
99
99
  # too taxing on performance.
100
100
  module Const
101
101
 
102
- PUMA_VERSION = VERSION = "2.15.1".freeze
102
+ PUMA_VERSION = VERSION = "2.15.2".freeze
103
103
  CODE_NAME = "Autumn Arbor Airbrush".freeze
104
104
 
105
105
  FAST_TRACK_KA_TIMEOUT = 0.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.1
4
+ version: 2.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix