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
; default route w/preproc support
(define (route-preproc path #:force force-value)
; default route
(define (route-default path #:force force-value)
(regenerate path #:force force-value))

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

Loading…
Cancel
Save