Nyxt: Use quri:uri in resource-request handlers and in status-formatter.

master
Pierre Neidhardt 2020-07-02 12:23:48 +02:00
parent b6c7fc0b0e
commit c2ffb68e4a
1 changed files with 6 additions and 9 deletions

View File

@ -61,16 +61,14 @@ Videos are downloaded with `+youtube-dl-command+'."
url)
(defun old-reddit-handler (request-data)
(let* ((url (url request-data))
(uri (quri:uri url)))
(let ((uri (url request-data)))
(setf (url request-data)
(if (search "reddit.com" (quri:uri-host uri))
(progn
(setf (quri:uri-host uri) "old.reddit.com")
(let ((new-url (quri:render-uri uri)))
(log:info "Switching to old Reddit: ~a" new-url)
new-url))
url)))
(log:info "Switching to old Reddit: ~s" (object-display uri))
uri)
uri)))
request-data)
(defvar *my-unproxied-domains*
@ -78,8 +76,7 @@ Videos are downloaded with `+youtube-dl-command+'."
"steampowered.com"))
(defun auto-proxy-handler (request-data)
(let* ((url (url request-data))
(uri (quri:uri url))
(let* ((uri (url request-data))
(domain (and uri (quri:uri-domain uri))))
;; TODO: Turn on/off proxy, not mode.
(when domain
@ -217,7 +214,7 @@ format."
(format nil " (~a/~a) ~a — ~a"
buffer-count
(length (buffer-list))
(url buffer)
(object-display (url buffer))
(title buffer)))))
(define-configuration window