Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9df001137ec6
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 024418dba4bb
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 15, 2016

  1. Copy the full SHA
    c672515 View commit details
  2. Merge pull request #3001 from MakeNowJust/fix/header-bug

    Fixed #2999: A bug not to allow '~' in HTTP header value
    Ary Borenszweig authored Jul 15, 2016
    Copy the full SHA
    024418d View commit details
Showing with 7 additions and 1 deletion.
  1. +6 −0 spec/std/http/headers_spec.cr
  2. +1 −1 src/http/headers.cr
6 changes: 6 additions & 0 deletions spec/std/http/headers_spec.cr
Original file line number Diff line number Diff line change
@@ -160,4 +160,10 @@ describe HTTP::Headers do
headers.includes_word?("foo", "bar").should be_false
headers.includes_word?("foo", "").should be_false
end

it "can create header value with all US-ASCII visible chars (#2999)" do
headers = HTTP::Headers.new
value = (32..126).map(&.chr).join
headers.add("foo", value)
end
end
2 changes: 1 addition & 1 deletion src/http/headers.cr
Original file line number Diff line number Diff line change
@@ -259,7 +259,7 @@ struct HTTP::Headers
value.each_byte do |byte|
char = byte.unsafe_chr
next if char == '\t'
if char < ' ' || char > '\u{ff}' || char == '\u{7e}'
if char < ' ' || char > '\u{ff}' || char == '\u{7f}'
raise ArgumentError.new("header content contains invalid character #{char.inspect}")
end
end