Function: verb--url-port

verb--url-port is a natively compiled function defined in verb.el.

Signature

(verb--url-port URL)

Documentation

Return port used by an HTTP URL.

Return nil if the port can be inferred from the URL's scheme.

Source Code

;; Defined in /nix/store/8jnfn8w2mxcxbr2crbklcnija9m0zlkq-emacs-packages-deps/share/emacs/site-lisp/elpa/verb-20260818.1921/verb.el
(defun verb--url-port (url)
  "Return port used by an HTTP URL.
Return nil if the port can be inferred from the URL's scheme."
  (let ((port (url-port url))
        (scheme (url-type url)))
    (if (and (numberp port)
             (or (and (= port 80) (string= scheme "http"))
                 (and (= port 443) (string= scheme "https"))))
        nil
      port)))