Changeset 13089 in project


Ignore:
Timestamp:
01/25/09 22:01:15 (11 years ago)
Author:
sjamaan
Message:

Fix URI normalization (probably needs some tweaking, but for now it's ok)

File:
1 edited

Legend:

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

    r13082 r13089  
    324324         (host-header (header-value 'host (request-headers (current-request)))))
    325325    (if request-host
    326         (values request-host (or (uri-port request-uri) 80))
     326        (values request-host (server-port))
    327327        (if host-header
    328328            (values (car host-header) (cdr host-header))
     
    330330                     (>= (request-minor (current-request)) 1))
    331331                (values #f #f)
    332                 (values (default-host) 80))))))
     332                (values (default-host) (server-port)))))))
    333333
    334334(define (normalize-current-request-uri)
    335   (receive (host port)
     335  (receive (vhost vport)
    336336    (determine-vhost/port)
    337337    (let* ((uri (request-uri (current-request)))
    338            (host (or host (uri-host uri)))
    339            (port (or port (uri-port uri))))
    340      (update-request (current-request)
    341                      uri: (update-uri uri host: host port: port)))))
     338           (host (or vhost (uri-host uri)))
     339           (port (or vport (uri-port uri) (server-port)))
     340           (scheme (or (uri-scheme uri) 'http))) ; XXX
     341      (update-request (current-request)
     342                      uri: (update-uri uri scheme: scheme host: host port: port)))))
    342343
    343344(define request-restarter (make-parameter #f)) ; Internal parameter
Note: See TracChangeset for help on using the changeset viewer.