Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use HTTP/1.0 for unsupported HTTP version reply. Do not send the tran…

…sfer-encoding header on empty body reply.
  • Loading branch information...
commit 8b16cf863918beedcd0ba62d04e13dcd7bc98657 1 parent 6683741
Laurent Parenteau authored
Showing with 5 additions and 14 deletions.
  1. +2 −2 r/databallet.m
  2. +3 −12 r/response.m
4 r/databallet.m
View
@@ -93,7 +93,7 @@ set conf("compressible","text/plain")=1
set conf("compressible","application/javascript")=1
; DataBallet version : YYYYMMDD
- set databalletver=20130201
+ set databalletver=20130206
quit
@@ -176,7 +176,7 @@ set connection("PORT")=$$FUNC^%UCASE($ztrnlnm("PORT","","","","","VALUE"))
. if connection("HTTPVER")="HTTP/1.1" set connection("CONNECTION")="KEEP-ALIVE" do keepalive(line) if 1
. else if connection("HTTPVER")="HTTP/1.0" set connection("CONNECTION")="CLOSE" do keepalive(line) if 1
. else if connection("HTTPVER")="" do serve09(line) if 1
- . else do senderr^response("505")
+ . else set connection("HTTPVER")="HTTP/1.0" do senderr^response("505")
quit
serve09(line)
15 r/response.m
View
@@ -42,20 +42,11 @@ set response("status")=status
; Send response headers
do sendresphdr()
- ; Headers end with a blank line
- write eol
-
- ; Send error data, if any
- set i=$order(response("content",""))
- for quit:i="" do
- . write response("content",i)
- . set i=$order(response("content",i))
-
- ; Log request/response
+ ; Make sure some required field are set before send response content
set:'$data(response("date")) response("date")=$horolog
set:'$data(request("method")) request("method")=""
set:'$data(request("uri")) request("uri")=""
- do log^log()
+ do send()
quit
@@ -80,7 +71,7 @@ set response("status")=status
. . use old
. set response("headers","Content-Type")=ct
- if $data(response("headers","Content-Type")) do
+ if ($data(response("file"))!$data(response("content"))) do
. ; Handle Accept-Encoding compression
. if $data(request("headers","ACCEPT-ENCODING")) do
. . set response("headers","Vary")="Accept-Encoding"
Please sign in to comment.
Something went wrong with that request. Please try again.