Skip to content

Commit

Permalink
HTTP: Make return value of Response#status_code an Int32 (#7682)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardiff authored Apr 16, 2019
1 parent 55f1735 commit 302b606
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/std/http/server/server_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ module HTTP
it "sets status code" do
io = IO::Memory.new
response = Response.new(io)
response.status_code = 201
return_value = response.status_code = 201
return_value.should eq 201
response.status.should eq HTTP::Status::CREATED
end

Expand Down
1 change: 1 addition & 0 deletions src/http/server/response.cr
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class HTTP::Server
# Convenience method to set the HTTP status code.
def status_code=(status_code : Int32)
self.status = HTTP::Status.new(status_code)
status_code
end

# See `IO#write(slice)`.
Expand Down

0 comments on commit 302b606

Please sign in to comment.