1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Ignore errors trying to update the backport tables. Fixes #788

This commit is contained in:
Evan Phoenix 2016-04-07 11:26:36 -07:00
parent 6fa830aa55
commit 791cd4af97
3 changed files with 49 additions and 39 deletions

View file

@ -7,22 +7,25 @@
# #
module URI module URI
TBLENCWWWCOMP_ = {} # :nodoc: begin
256.times do |i| TBLENCWWWCOMP_ = {} # :nodoc:
TBLENCWWWCOMP_[i.chr] = '%%%02X' % i 256.times do |i|
TBLENCWWWCOMP_[i.chr] = '%%%02X' % i
end
TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
TBLDECWWWCOMP_ = {} # :nodoc:
256.times do |i|
h, l = i>>4, i&15
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
end
TBLDECWWWCOMP_['+'] = ' '
TBLDECWWWCOMP_.freeze
rescue Exception
end end
TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
TBLDECWWWCOMP_ = {} # :nodoc:
256.times do |i|
h, l = i>>4, i&15
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
end
TBLDECWWWCOMP_['+'] = ' '
TBLDECWWWCOMP_.freeze
# Encode given +s+ to URL-encoded form data. # Encode given +s+ to URL-encoded form data.
# #

View file

@ -17,17 +17,20 @@
require 'uri/common' require 'uri/common'
module URI module URI
TBLDECWWWCOMP_ = {} unless const_defined?(:TBLDECWWWCOMP_) #:nodoc: begin
if TBLDECWWWCOMP_.empty? TBLDECWWWCOMP_ = {} unless const_defined?(:TBLDECWWWCOMP_) #:nodoc:
256.times do |i| if TBLDECWWWCOMP_.empty?
h, l = i>>4, i&15 256.times do |i|
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr h, l = i>>4, i&15
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
end
TBLDECWWWCOMP_['+'] = ' '
TBLDECWWWCOMP_.freeze
end end
TBLDECWWWCOMP_['+'] = ' ' rescue Exception
TBLDECWWWCOMP_.freeze
end end
def self.decode_www_form(str, enc=Encoding::UTF_8) def self.decode_www_form(str, enc=Encoding::UTF_8)

View file

@ -8,22 +8,26 @@ require 'uri/common'
# Relevant commit: # Relevant commit:
# https://github.com/ruby/ruby/commit/edb7cdf1eabaff78dfa5ffedfbc2e91b29fa9ca1 # https://github.com/ruby/ruby/commit/edb7cdf1eabaff78dfa5ffedfbc2e91b29fa9ca1
module URI
256.times do |i|
TBLENCWWWCOMP_[i.chr] = '%%%02X' % i
end
TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
256.times do |i| module URI
h, l = i>>4, i&15 begin
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr 256.times do |i|
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr TBLENCWWWCOMP_[i.chr] = '%%%02X' % i
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr end
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
256.times do |i|
h, l = i>>4, i&15
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
end
TBLDECWWWCOMP_['+'] = ' '
TBLDECWWWCOMP_.freeze
rescue Exception
end end
TBLDECWWWCOMP_['+'] = ' '
TBLDECWWWCOMP_.freeze
end end
# :startdoc: # :startdoc: