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


Ignore:
Timestamp:
11/24/08 20:56:52 (13 years ago)
Author:
sjamaan
Message:

Auto-normalize all uri references in intarweb parsers

File:
1 edited

Legend:

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

    r12532 r12586  
    3535; http://trac.callcc.org
    3636
     37(provide 'intarweb)
     38
    3739(module intarweb
    3840  (read-line-limit replace-header-contents replace-header-contents!
     
    141143        old-headers
    142144        headers-to-be))
     145
     146(define normalized-uri (compose uri-normalize-path-segments uri-reference))
    143147
    144148(include "header-parsers") ; Also includes header unparsers
     
    225229     (content-language . ,(multiple symbol-parser-ci))
    226230     (content-length . ,(single natnum-parser))
    227      (content-location . ,(single uri-reference))
     231     (content-location . ,(single normalized-uri))
    228232     (content-md5 . ,(single md5-parser))
    229233     (content-range . ,(single range-parser))
     
    241245     (if-unmodified-since . ,(single rfc822-time-parser))
    242246     (last-modified . ,(single rfc822-time-parser))
    243      (location . ,(single uri-reference))
     247     (location . ,(single normalized-uri))
    244248     (max-forwards . ,(single natnum-parser))
    245249     (pragma . ,pragma-parser)
     
    247251     (proxy-authorization . ,(single symbol-parser-ci))
    248252     (range . ,range-parser)
    249      (referer . ,(single uri-reference))
     253     (referer . ,(single normalized-uri))
    250254     (retry-after . ,retry-after-parser)
    251255     (server . ,product-parser)
     
    321325    ("[Gg][Ee][Tt] +([^ \t]+)"
    322326     (_ uri)
    323      (make-request method: 'GET uri: (uri-reference uri)
     327     (make-request method: 'GET uri: (normalized-uri uri)
    324328                   major: 0 minor: 9
    325329                   port: in))
     
    331335   ("([a-zA-Z]+) +([^ \t]+) +[Hh][Tt][Tt][Pp]/([0-9]+)\\.([0-9]+)"
    332336    (_ method uri major minor)
    333     (make-request method: (string->http-method method) uri: (uri-reference uri)
     337    (make-request method: (string->http-method method) uri: (normalized-uri uri)
    334338                  major: (string->number major)
    335339                  minor: (string->number minor)
Note: See TracChangeset for help on using the changeset viewer.