mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-21 08:50:51 +01:00
- fixed 'make-gemini-iri', was building wrong IRI with ipv6 address as host.
This commit is contained in:
parent
32e1394422
commit
90bad8b21c
@ -247,8 +247,11 @@
|
||||
(actual-port (if port
|
||||
(to-s port)
|
||||
(to-s +gemini-default-port+)))
|
||||
(actual-host (if (iri:ipv6-address-p host)
|
||||
(strcat "[" host "]")
|
||||
host))
|
||||
(iri (strcat scheme "://"
|
||||
host ":"
|
||||
actual-host ":"
|
||||
actual-port "/"
|
||||
actual-path)))
|
||||
(when query
|
||||
|
@ -335,3 +335,15 @@
|
||||
(defun absolute-url-p (url)
|
||||
(when-let ((iri (iri:iri-parse url :null-on-error t)))
|
||||
(not (null (uri:scheme iri)))))
|
||||
|
||||
(defun ipv4-address-p (string)
|
||||
(ignore-errors
|
||||
(let ((bytes (mapcar #'parse-integer
|
||||
(cl-ppcre:split "\\."
|
||||
string))))
|
||||
(and (= (length bytes)
|
||||
4)
|
||||
(every (lambda (a) (<= 0 a 255)) bytes)))))
|
||||
|
||||
(defun ipv6-address-p (string)
|
||||
(cl-ppcre:scan ":" string))
|
||||
|
@ -676,7 +676,9 @@
|
||||
:render-iri
|
||||
:make-iri
|
||||
:iri-parse
|
||||
:absolute-url-p))
|
||||
:absolute-url-p
|
||||
:ipv4-address-p
|
||||
:ipv6-address-p))
|
||||
|
||||
(defpackage :x509
|
||||
(:use
|
||||
|
Loading…
x
Reference in New Issue
Block a user