pass through /inform requests

pull/9/head
Matthew Butterick 11 years ago
parent 54067d8f1e
commit b48f1dcdd6

@ -146,6 +146,6 @@
(and result (cdar result)))) ; second value of first result (and result (cdar result)))) ; second value of first result
; default route w/preproc support ; default route
(define (route-preproc path #:force force-value) (define (route-default path #:force force-value)
(regenerate path #:force force-value)) (regenerate path #:force force-value))

@ -23,11 +23,12 @@
[("html" (string-arg)) (route-wrapper route-html)] [("html" (string-arg)) (route-wrapper route-html)]
[else (λ(req) [else (λ(req)
;; because it's the "else" route, can't use string-arg matcher ;; because it's the "else" route, can't use string-arg matcher
;; so extract the path manually (define request-url (request-uri req))
(define req-uri (request-uri req)) ;; /inform is a magic servlet that must be allowed to pass through
(define path (reroot-path (url->path req-uri) pollen-file-root)) (when (not (equal? (url->string request-url) "/inform"))
(define force (equal? (get-query-value req-uri 'force) "true")) (let ([path (reroot-path (url->path request-url) pollen-file-root)]
(route-preproc path #:force force) [force (equal? (get-query-value request-url 'force) "true")])
(route-default path #:force force)))
(next-dispatcher))])) (next-dispatcher))]))
(displayln "Ready to rock") (displayln "Ready to rock")

Loading…
Cancel
Save