From 06e85cc6060478cda1ff3ec98f23d5f1c495a1e0 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 23 Jun 2018 11:39:49 -0700 Subject: [PATCH] http.server: Actually use the port remapping instead of throwing it away. For a port 8080 remapped to port 80, the ``or`` in this line looks like ``8080 80 or`` which doesn't get the remapped port. Fixes #692 and #1992. --- basis/http/server/server.factor | 42 ++++++++------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/basis/http/server/server.factor b/basis/http/server/server.factor index 583920c49b..1467ff25f0 100644 --- a/basis/http/server/server.factor +++ b/basis/http/server/server.factor @@ -1,36 +1,14 @@ ! Copyright (C) 2003, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel accessors sequences arrays namespaces splitting -vocabs.loader destructors assocs debugger continuations -combinators combinators.short-circuit vocabs.refresh -tools.time math present vectors hashtables -io -io.sockets -io.sockets.secure -io.encodings -io.encodings.iana -io.encodings.utf8 -io.encodings.ascii -io.encodings.binary -io.streams.limited -io.streams.string -io.streams.throwing -io.servers -io.timeouts -io.crlf -fry logging logging.insomniac calendar urls -unicode -http -http.server.requests -http.server.responses -http.server.remapping -html.templates -html.streams -html -mime.types -math.order -xml.writer -vocabs ; +USING: accessors arrays assocs combinators +combinators.short-circuit continuations debugger destructors fry +hashtables html html.streams html.templates http +http.server.remapping http.server.requests http.server.responses +io io.crlf io.encodings io.encodings.ascii io.encodings.iana +io.encodings.utf8 io.servers io.sockets io.sockets.secure +io.streams.limited kernel logging logging.insomniac math +mime.types namespaces present sequences splitting tools.time +urls vectors vocabs vocabs.refresh xml.writer ; IN: http.server GENERIC: write-response ( response -- ) @@ -187,7 +165,7 @@ SYMBOL: params [ local-address get [ secure? "https" "http" ? >>protocol ] - [ port>> remap-port '[ _ or ] change-port ] + [ port>> remap-port >>port ] bi ] change-url drop ;