This commit is contained in:
blankie 2022-10-08 22:42:43 +07:00
parent 1c676fd5a0
commit f6b448ae8f
Signed by: blankie
GPG key ID: CC15FC822C7F61F5

View file

@ -32,15 +32,15 @@
(log-outgoing image-url)
(define dest-res (easy:head image-url #:timeouts timeouts))
(define content-type (easy:response-headers-ref dest-res 'Content-Type))
`(cond
[(eq? content-type #f) ""]
(cond
[(eq? content-type #f) `""]
[(regexp-match? #rx"^image/" content-type)
'(img (@ (src ,(u-proxy-url image-url))))]
`(img (@ (src ,(u-proxy-url image-url))))]
[(regexp-match? #rx"^audio/" content-type)
'(audio (@ (src ,(u-proxy-url image-url)) (controls)))]
`(audio (@ (src ,(u-proxy-url image-url)) (controls)))]
[(regexp-match? #rx"^video/" content-type)
'(video (@ (src ,(u-proxy-url image-url)) (controls)))]
[else ""]))
`(video (@ (src ,(u-proxy-url image-url)) (controls)))]
[else `""]))
(define (generate-results-page
#:source-url source-url