Changeset 33896 in project for release/4/intarweb/trunk/intarweb.scm


Ignore:
Timestamp:
03/19/17 20:02:53 (4 years ago)
Author:
sjamaan
Message:

Intarweb: Add chunking support for request parsing as well

File:
1 edited

Legend:

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

    r33321 r33896  
    22;;; Intarweb is an improved HTTP library for Chicken
    33;;;
    4 ;; Copyright (c) 2008-2015, Peter Bex
     4;; Copyright (c) 2008-2017, Peter Bex
    55;; All rights reserved.
    66;;
     
    587587                 (headers (read-headers in)))
    588588        (let* ((wildcard (string=? uri-string "*"))
    589                (uri (and (not wildcard) (normalized-uri uri-string))))
     589               (uri (and (not wildcard) (normalized-uri uri-string)))
     590               ;; HTTP/1.0 has no chunking
     591               (port (if (and (or (> major 1) (>= minor 1))
     592                              (memq 'chunked
     593                                    (header-values
     594                                     'transfer-encoding headers)))
     595                         (chunked-input-port in)
     596                         in)))
    590597          ;; HTTP/1.1 allows several "things" as "URI" (RFC2616, 5.1.2):
    591598          ;; Request-URI = "*" | absoluteURI | abs_path | authority
     
    607614                             major: major minor: minor
    608615                             headers: headers
    609                              port: in)))))))
     616                             port: port)))))))
    610617
    611618(define request-parsers   ; order matters here
Note: See TracChangeset for help on using the changeset viewer.