snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 81cf1e21a646568323681df2763e66f933bee48f
parent c9df6707abc8a8d2b7815f5210cf3667be6fb9b1
Author: default <nobody@localhost>
Date:   Sun, 14 Apr 2024 19:24:06 +0200

Better redirection URL building in oauth_post_handler().

Diffstat:
Mmastoapi.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 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; }