Wrap all pages in response safety checker
This commit is contained in:
		
							parent
							
								
									6260ba809b
								
							
						
					
					
						commit
						7dff049ece
					
				
					 2 changed files with 10 additions and 11 deletions
				
			
		|  | @ -56,20 +56,20 @@ | ||||||
|     (sequencer:make |     (sequencer:make | ||||||
|      subdomain-dispatcher |      subdomain-dispatcher | ||||||
|      (pathprocedure:make "/" (page ds page-home)) |      (pathprocedure:make "/" (page ds page-home)) | ||||||
|      (pathprocedure:make "/proxy" (hash-ref ds 'page-proxy)) |      (pathprocedure:make "/proxy" (page ds page-proxy)) | ||||||
|      (pathprocedure:make "/search" (hash-ref ds 'page-global-search)) |      (pathprocedure:make "/search" (page ds page-global-search)) | ||||||
|      (pathprocedure:make "/set-user-settings" (hash-ref ds 'page-set-user-settings)) |      (pathprocedure:make "/set-user-settings" (page ds page-set-user-settings)) | ||||||
|      (pathprocedure:make "/buddyfight/wiki/It_Doesn't_Work!!" (hash-ref ds 'page-it-works)) |      (pathprocedure:make "/buddyfight/wiki/It_Doesn't_Work!!" (page ds page-it-works)) | ||||||
|      (filter:make (pregexp (format "^/~a/wiki/Category:.+$" px-wikiname)) (lift:make (hash-ref ds 'page-category))) |      (filter:make (pregexp (format "^/~a/wiki/Category:.+$" px-wikiname)) (lift:make (page ds page-category))) | ||||||
|      (filter:make (pregexp (format "^/~a/wiki/File:.+$" px-wikiname)) (lift:make (hash-ref ds 'page-file))) |      (filter:make (pregexp (format "^/~a/wiki/File:.+$" px-wikiname)) (lift:make (page ds page-file))) | ||||||
|      (if (config-true? 'feature_offline::enabled) |      (if (config-true? 'feature_offline::enabled) | ||||||
|          (filter:make (pregexp (format "^/~a/wiki/.+$" px-wikiname)) (lift:make (hash-ref ds 'page-wiki-offline))) |          (filter:make (pregexp (format "^/~a/wiki/.+$" px-wikiname)) (lift:make (page ds page-wiki-offline))) | ||||||
|          (λ (_conn _req) (next-dispatcher))) |          (λ (_conn _req) (next-dispatcher))) | ||||||
|      (filter:make (pregexp (format "^/~a/wiki/.+$" px-wikiname)) (lift:make (page ds page-wiki))) |      (filter:make (pregexp (format "^/~a/wiki/.+$" px-wikiname)) (lift:make (page ds page-wiki))) | ||||||
|      (filter:make (pregexp (format "^/~a/search$" px-wikiname)) (lift:make (hash-ref ds 'page-search))) |      (filter:make (pregexp (format "^/~a/search$" px-wikiname)) (lift:make (page ds page-search))) | ||||||
|      (filter:make (pregexp (format "^/~a(/(wiki(/)?)?)?$" px-wikiname)) (lift:make (hash-ref ds 'redirect-wiki-home))) |      (filter:make (pregexp (format "^/~a(/(wiki(/)?)?)?$" px-wikiname)) (lift:make (page ds redirect-wiki-home))) | ||||||
|      (if (config-true? 'feature_offline::enabled) |      (if (config-true? 'feature_offline::enabled) | ||||||
|          (filter:make (pregexp (format "^/archive/~a/(styles|images)/.+$" px-wikiname)) (lift:make (hash-ref ds 'page-static-archive))) |          (filter:make (pregexp (format "^/archive/~a/(styles|images)/.+$" px-wikiname)) (lift:make (page ds page-static-archive))) | ||||||
|          (λ (_conn _req) (next-dispatcher))) |          (λ (_conn _req) (next-dispatcher))) | ||||||
|      (hash-ref ds 'static-dispatcher) |      (hash-ref ds 'static-dispatcher) | ||||||
|      (lift:make (hash-ref ds 'page-not-found)))) |      (lift:make (hash-ref ds 'page-not-found)))) | ||||||
|  |  | ||||||
|  | @ -35,7 +35,6 @@ | ||||||
|                              ("hl.tag.post" . "</mark>") |                              ("hl.tag.post" . "</mark>") | ||||||
|                              ("sort" . ,(cdr sort)))))) |                              ("sort" . ,(cdr sort)))))) | ||||||
|   ;; HTTP request to dest-url for search results |   ;; HTTP request to dest-url for search results | ||||||
|   (log-outgoing dest-url) |  | ||||||
|   (define res (easy:get dest-url #:timeouts (easy:make-timeout-config #:lease 5 #:connect 5))) |   (define res (easy:get dest-url #:timeouts (easy:make-timeout-config #:lease 5 #:connect 5))) | ||||||
|   (define json (easy:response-json res)) |   (define json (easy:response-json res)) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue