test/stallion.rb in em-http-request-0.2.2 vs test/stallion.rb in em-http-request-0.2.3
- old
+ new
@@ -83,11 +83,17 @@
elsif stable.request.path_info == '/echo_content_length'
stable.response.write stable.request.content_length
elsif stable.request.head?
stable.response.status = 200
-
+
+ elsif stable.request.delete?
+ stable.response.status = 200
+
+ elsif stable.request.put?
+ stable.response.write stable.request.body.read
+
elsif stable.request.post?
if stable.request.path_info == '/echo_content_type'
stable.response.write stable.request.env["CONTENT_TYPE"]
else
stable.response.write stable.request.body.read
@@ -127,9 +133,13 @@
stable.response.status = 200
stable.response.write 'success'
else
stable.response.status = 401
end
+
+ elsif stable.request.path_info == '/relative-location'
+ stable.response.status = 301
+ stable.response["Location"] = '/forwarded'
elsif
stable.response.write 'Hello, World!'
end
\ No newline at end of file