puma 4.3.6-java → 4.3.7-java

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
  SHA256:
3
- metadata.gz: 4891b3e0d2c7fa2224e33911223bdeb443d2ce37e8ac8f837b199a72103f5f32
4
- data.tar.gz: e646b0ee7e8d531b467994ead1d03ff6f68727529e73be9ce8ed71ad50c1006d
3
+ metadata.gz: 781f3047448b2b27145e6c7c6f4a98f9d61485ca579242ec5760fea20cabe642
4
+ data.tar.gz: 161a15f8d95b8aafb36596d15efcd58feb37f5777656c6d755e061e3208667b0
5
5
  SHA512:
6
- metadata.gz: 996aa525831fc6a49d7b039189f4940a3bbb684a817f58303232dbfd004e5b83685c1a0955afcb255c3be30e235001b5c4d56c7e8be03d3db7d7e4d5cccd1249
7
- data.tar.gz: 933a55a70a75b2727346fab1b8d98ebe54d4e7d45a8173eeae87d56469b7a17f7c150f7dca9650ef10ed9e32fa07bc82ccd8738e58269f23ec5bf27420a033d5
6
+ metadata.gz: 026e69eb534503bae1b15b76f120678941cadd743630f4b93c3941719b4fcd49616af0bbc89fdad3e06bea86ebd7d11bc438d6223d368b21cb434c36f9d39db0
7
+ data.tar.gz: 10aa9559de2ecdbb9fe7dd5760075d65618c408023de766994bc6e3c0679e7e76480a1f5b9bf51874805ca68047dd34574323e5dcc7d0ef0874f8c433abea648
data/History.md CHANGED
@@ -1,8 +1,14 @@
1
+ ## 4.3.7 / 2020-11-30
2
+
3
+ * Bugfixes
4
+ * Backport set CONTENT_LENGTH for chunked requests (Originally: #2287, backport: #2496)
5
+
1
6
  ## 4.3.6 / 2020-09-05
2
7
 
3
8
  * Bugfixes
4
9
  * Explicitly include ctype.h to fix compilation warning and build error on macOS with Xcode 12 (#2304)
5
10
  * Don't require json at boot (#2269)
11
+ * Set `CONTENT_LENGTH` for chunked requests (#2287)
6
12
 
7
13
  ## 4.3.4/4.3.5 and 3.12.5/3.12.6 / 2020-05-22
8
14
 
@@ -1,7 +1,7 @@
1
1
  require 'mkmf'
2
2
 
3
3
  dir_config("puma_http11")
4
- if RUBY_PLATFORM[/mingw32/]
4
+ if $mingw && RUBY_VERSION >= '2.4'
5
5
  append_cflags '-D_FORTIFY_SOURCE=2'
6
6
  append_ldflags '-fstack-protector'
7
7
  have_library 'ssp'
@@ -153,7 +153,7 @@ module Puma
153
153
 
154
154
  begin
155
155
  data = @io.read_nonblock(CHUNK_SIZE)
156
- rescue Errno::EAGAIN
156
+ rescue IO::WaitReadable
157
157
  return false
158
158
  rescue SystemCallError, IOError, EOFError
159
159
  raise ConnectionError, "Connection error detected during read"
@@ -351,7 +351,7 @@ module Puma
351
351
 
352
352
  begin
353
353
  chunk = @io.read_nonblock(want)
354
- rescue Errno::EAGAIN
354
+ rescue IO::WaitReadable
355
355
  return false
356
356
  rescue SystemCallError, IOError
357
357
  raise ConnectionError, "Connection error detected during read"
@@ -397,7 +397,10 @@ module Puma
397
397
  raise EOFError
398
398
  end
399
399
 
400
- return true if decode_chunk(chunk)
400
+ if decode_chunk(chunk)
401
+ @env[CONTENT_LENGTH] = @chunked_content_length
402
+ return true
403
+ end
401
404
  end
402
405
  end
403
406
 
@@ -410,19 +413,28 @@ module Puma
410
413
  @body.binmode
411
414
  @tempfile = @body
412
415
 
413
- return decode_chunk(body)
416
+ @chunked_content_length = 0
417
+
418
+ if decode_chunk(body)
419
+ @env[CONTENT_LENGTH] = @chunked_content_length
420
+ return true
421
+ end
422
+ end
423
+
424
+ def write_chunk(str)
425
+ @chunked_content_length += @body.write(str)
414
426
  end
415
427
 
416
428
  def decode_chunk(chunk)
417
429
  if @partial_part_left > 0
418
430
  if @partial_part_left <= chunk.size
419
431
  if @partial_part_left > 2
420
- @body << chunk[0..(@partial_part_left-3)] # skip the \r\n
432
+ write_chunk(chunk[0..(@partial_part_left-3)]) # skip the \r\n
421
433
  end
422
434
  chunk = chunk[@partial_part_left..-1]
423
435
  @partial_part_left = 0
424
436
  else
425
- @body << chunk if @partial_part_left > 2 # don't include the last \r\n
437
+ write_chunk(chunk) if @partial_part_left > 2 # don't include the last \r\n
426
438
  @partial_part_left -= chunk.size
427
439
  return false
428
440
  end
@@ -469,12 +481,12 @@ module Puma
469
481
 
470
482
  case
471
483
  when got == len
472
- @body << part[0..-3] # to skip the ending \r\n
484
+ write_chunk(part[0..-3]) # to skip the ending \r\n
473
485
  when got <= len - 2
474
- @body << part
486
+ write_chunk(part)
475
487
  @partial_part_left = len - part.size
476
488
  when got == len - 1 # edge where we get just \r but not \n
477
- @body << part[0..-2]
489
+ write_chunk(part[0..-2])
478
490
  @partial_part_left = len - part.size
479
491
  end
480
492
  else
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "4.3.6".freeze
103
+ PUMA_VERSION = VERSION = "4.3.7".freeze
104
104
  CODE_NAME = "Mysterious Traveller".freeze
105
105
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
106
106
 
Binary file
@@ -694,7 +694,7 @@ module Puma
694
694
  to_add = {}
695
695
  end
696
696
 
697
- to_add[k.gsub(",", "_")] = v
697
+ to_add[k.tr(",", "_")] = v
698
698
  end
699
699
  end
700
700
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.6
4
+ version: 4.3.7
5
5
  platform: java
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-05 00:00:00.000000000 Z
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement