summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-04-14 19:24:06 +0200
committerdefault <nobody@localhost>2024-04-14 19:24:06 +0200
commit81cf1e21a646568323681df2763e66f933bee48f (patch)
treedee4bdcf54e6c0d0bfea0f624075f60c4094a0c0 /mastoapi.c
parentc9df6707abc8a8d2b7815f5210cf3667be6fb9b1 (diff)
Better redirection URL building in oauth_post_handler().
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 36f7238..2b52972 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -289,7 +289,11 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
*body = xs_dup(code);
}
else {
- *body = xs_fmt("%s?code=%s", redir, code);
+ if (xs_str_in(redir, "?"))
+ *body = xs_fmt("%s&code=%s", redir, code);
+ else
+ *body = xs_fmt("%s?code=%s", redir, code);
+
status = 303;
}