Skip to content

Commit

Permalink
rubocop style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kenichi committed Oct 27, 2016
1 parent fb31af5 commit dbc8fbb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions example/upgrade_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
def request_header_hash
Hash.new do |hash, key|
k = key.to_s.downcase
k.gsub! '_', '-'
_, value = hash.find {|header_key,v| header_key.downcase == k}
k.tr! '_', '-'
_, value = hash.find { |header_key, _| header_key.downcase == k }
hash[key] = value if value
end
end
Expand Down Expand Up @@ -136,9 +136,7 @@ def on_message_complete

if req['Upgrade']
log.info "Processing h2c Upgrade request: #{req}"

# Don't respond to OPTIONS...
if req[':method'] != 'OPTIONS'
if req[':method'] != 'OPTIONS' # Don't respond to OPTIONS...
response = 'Hello h2c world!'
stream.headers({
':status' => '200',
Expand Down

0 comments on commit dbc8fbb

Please sign in to comment.