Handbook
Glossary
ensure-port ( url -- url' )
Furnace framework
ยป
URL objects
Prev:
relative-url ( url -- url' )
Next:
query-param ( url key -- value )
Vocabulary
urls
Inputs
url
an
url
Outputs
url'
an
url
Word description
If the URL does not specify a port number, create a new URL which is equal except the port number is set to the default for the URL's protocol. If the protocol is unknown, outputs an exact copy of the input URL.
Examples
USING: accessors prettyprint urls ; URL" https://concatenative.org" ensure-port port>> .
443
Definition
USING:
accessors
kernel
protocols
;
IN:
urls
:
ensure-port
( url -- url' )
clone
dup
protocol>>
[
lookup-protocol-port
or
]
curry
change-port
;