Skip to content

Commit

Permalink
urls: improve derive-url to coerce the arguments to urls.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Nov 8, 2024
1 parent 952ca84 commit a7550a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions basis/urls/urls-docs.factor
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ HELP: derive-url
"URL\" master-cleanser\" derive-url ."
"URL\" http://www.truecasey.com/drinks/master-cleanser\""
}
{ $example
"USING: prettyprint urls ;"
"\"https://factorcode.org\""
"\"index.html\" derive-url ."
"URL\" https://factorcode.org/index.html\""
}
} ;

HELP: ensure-port
Expand Down
2 changes: 1 addition & 1 deletion basis/urls/urls.factor
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ PRIVATE>
PRIVATE>

: derive-url ( base url -- url' )
[ clone ] dip over {
[ >url clone ] dip >url over {
[ [ protocol>> ] either? >>protocol ]
[ [ username>> ] either? >>username ]
[ [ password>> ] either? >>password ]
Expand Down

0 comments on commit a7550a4

Please sign in to comment.