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 +4 -4
- data/History.txt +10 -0
- data/ext/puma_http11/org/jruby/puma/Http11.java +12 -3
- data/ext/puma_http11/puma_http11.c +12 -4
- data/lib/puma/binder.rb +1 -1
- data/lib/puma/const.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1173eb40e9b144235b309616535fe6bec2e2b782
|
4
|
+
data.tar.gz: d70686709d9be7b38eb308dd1ee423dfda95cdda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67548e119a3b36cb2bf6584019534d022c7b15078f937ee4e8c9fcaa550c2b7c3780b70c4d6d05f781321d174f39ced057dacf1d438452ccbcb531a52377146d
|
7
|
+
data.tar.gz: 7e444777b053f067ef7e1c44c1063aa18ffa753e21adad669851328eac037cebe6b4dc9b8bcf43e84cf3b7ec839cc6191cada672eafcf1ce212e709e0568540f
|
data/History.txt
CHANGED
@@ -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
|
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
|
-
|
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
|
-
|
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)
|
data/lib/puma/binder.rb
CHANGED
data/lib/puma/const.rb
CHANGED