aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-15 18:24:24 +0000
committerOmar Polo <op@omarpolo.com>2021-01-15 18:24:24 +0000
commitb777bf4b2be13429a31eaefdc89ceaf9fe252f24 (patch)
treefb357f67da8b779ca9d08f93076e0461a7339515
parentf7b816dc398efba2fb1cd4e2982ee3b23eed624f (diff)
check also that the port number matches
-rw-r--r--gmid.c2
-rw-r--r--iri.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/gmid.c b/gmid.c
index f4948bd..ded80cd 100644
--- a/gmid.c
+++ b/gmid.c
@@ -639,7 +639,7 @@ handle_open_conn(struct pollfd *fds, struct client *c)
return;
}
- if (strcmp(iri.schema, "gemini")) {
+ if (strcmp(iri.schema, "gemini") || iri.port_no != conf.port) {
if (!start_reply(fds, c, PROXY_REFUSED, "won't proxy request"))
return;
goodbye(fds, c);
diff --git a/iri.c b/iri.c
index 1e08e0f..d6f6d24 100644
--- a/iri.c
+++ b/iri.c
@@ -160,7 +160,8 @@ parse_authority(struct parser *p)
*p->iri = '\0';
p->iri++;
return parse_port(p);
- }
+ } else
+ p->parsed->port_no = 1965;
if (*p->iri == '/') {
*p->iri = '\0';