Changeset 18098 in project


Ignore:
Timestamp:
05/16/10 16:03:10 (9 years ago)
Author:
Moritz Heidkamp
Message:

steal zbigniew's improved redirect-to

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/spiffy-uri-match/trunk/spiffy-uri-match.scm

    r18097 r18098  
    1 (module spiffy-uri-match (redirect-to default-response-headers uri-match/spiffy)
     1(module spiffy-uri-match
     2
     3(redirect-to default-response-headers uri-match/spiffy)
    24
    35(import chicken scheme)
    46(use uri-match spiffy uri-common intarweb extras)
    57
    6 (define (redirect-to path #!key (headers '()))
    7   (send-response code: 302
    8                  headers: (append `((connection close)
    9                                     (location ,(update-uri (request-uri (current-request))
    10                                                            path: path))) headers)))
     8(define (redirect-to path #!key (code 302) (headers '()))
     9  (send-response code: code
     10                 headers: `((location ,(uri-relative-to
     11                                        (uri-reference path)
     12                                        (server-root-uri)))
     13                            . ,headers)))
    1114
    1215(define default-response-headers
Note: See TracChangeset for help on using the changeset viewer.