mirror of https://codeberg.org/cage/tinmop/
- [gemini] omitted default port when building URI.
This commit is contained in:
parent
a2e9016bf7
commit
c5ccfa2d26
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
(defparameter *raw-mode-data* nil)
|
(defparameter *raw-mode-data* nil)
|
||||||
|
|
||||||
|
(defparameter *omitted-port* +gemini-default-port+)
|
||||||
|
|
||||||
(define-constant +h1-prefix+ "#" :test #'string=)
|
(define-constant +h1-prefix+ "#" :test #'string=)
|
||||||
|
|
||||||
(define-constant +h2-prefix+ "##" :test #'string=)
|
(define-constant +h2-prefix+ "##" :test #'string=)
|
||||||
|
@ -240,18 +242,29 @@
|
||||||
(query nil)
|
(query nil)
|
||||||
(port +gemini-default-port+)
|
(port +gemini-default-port+)
|
||||||
(fragment nil)
|
(fragment nil)
|
||||||
(scheme +gemini-scheme+))
|
(scheme +gemini-scheme+)
|
||||||
(let* ((actual-path (if (string-starts-with-p "/" path)
|
(omit-default-port t)
|
||||||
(subseq path 1)
|
(default-port *omitted-port*))
|
||||||
path))
|
(let* ((actual-path (if (string-starts-with-p "/" path)
|
||||||
(actual-port (if port
|
(subseq path 1)
|
||||||
(to-s port)
|
path))
|
||||||
(to-s +gemini-default-port+)))
|
(actual-port (cond
|
||||||
(actual-host (if (iri:ipv6-address-p host)
|
((and (not omit-default-port)
|
||||||
(strcat "[" host "]")
|
(null default-port))
|
||||||
host))
|
(to-s +gemini-default-port+))
|
||||||
|
((or (null default-port)
|
||||||
|
(= port *omitted-port*))
|
||||||
|
"")
|
||||||
|
(t
|
||||||
|
(to-s port))))
|
||||||
|
(domain-port-separator (if (string-not-empty-p actual-port)
|
||||||
|
":"
|
||||||
|
""))
|
||||||
|
(actual-host (if (iri:ipv6-address-p host)
|
||||||
|
(strcat "[" host "]")
|
||||||
|
host))
|
||||||
(iri (strcat scheme "://"
|
(iri (strcat scheme "://"
|
||||||
actual-host ":"
|
actual-host domain-port-separator
|
||||||
actual-port "/"
|
actual-port "/"
|
||||||
actual-path)))
|
actual-path)))
|
||||||
(when query
|
(when query
|
||||||
|
|
Loading…
Reference in New Issue