1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-30 04:14:47 +01:00

- [gemini] percent encoded query.

This commit is contained in:
cage 2020-06-23 15:22:28 +02:00
parent adb83bf462
commit f861d80b8c
5 changed files with 8 additions and 2 deletions

View File

@ -122,6 +122,7 @@ install_dependency () {
--eval "(ql:quickload \"cffi\")" \ --eval "(ql:quickload \"cffi\")" \
--eval "(ql:quickload \"babel\")" \ --eval "(ql:quickload \"babel\")" \
--eval "(ql:quickload \"puri\")" \ --eval "(ql:quickload \"puri\")" \
--eval "(ql:quickload \"percent-encoding\")" \
--eval "(sb-ext:quit)"; --eval "(sb-ext:quit)";
} }

View File

@ -218,7 +218,7 @@
(let* ((uri (make-gemini-uri host path query port)) (let* ((uri (make-gemini-uri host path query port))
(ctx (cl+ssl:make-context :verify-mode cl+ssl:+ssl-verify-none+))) (ctx (cl+ssl:make-context :verify-mode cl+ssl:+ssl-verify-none+)))
(when query (when query
(setf uri (strcat uri "?" query))) (setf uri (strcat uri "?" (percent-encode query))))
(cl+ssl:with-global-context (ctx :auto-free-p t) (cl+ssl:with-global-context (ctx :auto-free-p t)
(let ((socket (usocket:socket-connect host port :element-type '(unsigned-byte 8)))) (let ((socket (usocket:socket-connect host port :element-type '(unsigned-byte 8))))
(unwind-protect (unwind-protect

View File

@ -355,7 +355,8 @@
:annotated-text-symbol :annotated-text-symbol
:annotated-text-value :annotated-text-value
:box-fit-multiple-column-annotated :box-fit-multiple-column-annotated
:collect-links)) :collect-links
:percent-encode))
(defpackage :html-utils (defpackage :html-utils
(:use (:use

View File

@ -670,3 +670,6 @@ printed in the box column by column; in the example above the results are:
results results
:test #'string=)) :test #'string=))
results))) results)))
(defun percent-encode (string)
(percent-encoding:encode string :encoding :utf-8))

View File

@ -50,6 +50,7 @@
:usocket :usocket
:babel :babel
:puri :puri
:percent-encoding
:uiop) :uiop)
:components ((:file "package") :components ((:file "package")
(:file "config") (:file "config")