Changeset 33918 in project


Ignore:
Timestamp:
04/02/17 14:04:02 (4 months ago)
Author:
sjamaan
Message:

intarweb: Assume HTTP 1.0 requests have a message body when the connection is not keep-alive (it may of course be empty)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/intarweb/trunk/intarweb.scm

    r33896 r33918  
    320320;; We don't check the method since "a server SHOULD read and forward the
    321321;; a message-body on any request", even it shouldn't be sent for that method.
     322;;
     323;; Because HTTP/1.0 has no official definition of when a message body
     324;; is present, we'll assume it's always present, unless there is no
     325;; content-length and we have a keep-alive connection.
    322326(define request-has-message-body?
    323327  (make-parameter
    324328   (lambda (req)
    325329     (let ((headers (request-headers req)))
    326        (or (header-contents 'content-length headers)
    327            (header-contents 'transfer-encoding headers))))))
     330       (if (and (= 1 (request-major req)) (= 0 (request-minor req)))
     331           (not (eq? 'keep-alive (header-contents 'connection headers)))
     332           (or (header-contents 'content-length headers)
     333               (header-contents 'transfer-encoding headers)))))))
    328334
    329335;; RFC2616, Section 4.3: "For response messages, whether or not a
Note: See TracChangeset for help on using the changeset viewer.