Skip to content

Commit

Permalink
Add some docstrings
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information
Sam Phippen committed Sep 5, 2012
1 parent 32e0a92 commit 5f79c38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/http/request_stream.rb
Expand Up @@ -8,12 +8,15 @@ def initialize(socket, body, headers, headerstart)
@request_header = [headerstart]
end

#Adds headers to the request header from the headers array
def add_headers
@headers.each do |field, value|
@request_header << "#{field}: #{value}"
end
end

# Adds the headers to the header array for the given request body we are working
# with
def add_body_type_headers
if @body.class == String and not @headers['Content-Length']
@request_header << "Content-Length: #{@body.length}"
Expand All @@ -26,6 +29,8 @@ def add_body_type_headers
end
end

# Joins the headers specified in the request into a correctly formatted
# http request header string
def join_headers
# join the headers array with crlfs, stick two on the end because
# that ends the request header
Expand Down

0 comments on commit 5f79c38

Please sign in to comment.