Commit Diff


commit - 014fbe8cd308fa0ef1839e98ae396df9dae27848ea84bb1fcd916d89e65b752c
commit + dca4220f4aa2f7af92383fe1e31d2f8ff7e11b305c61377ef6d62fa5035727d4
blob - ee4064a232b61c2d01eff71193163f27af98ac563c2ed1a1d7b856fbdcd8c404
blob + 23560b79c2a1b5547a2a2d85b159c170110f3fa5c8c0bc83a36a9fff3e1e94b0
--- gotwebd/login.c	
+++ gotwebd/login.c	
@@ -503,7 +503,7 @@ client_read(struct bufferevent *bev, void *d)
 	struct evbuffer *out = EVBUFFER_OUTPUT(bev);
 	char *line, *cmd, *code;
 	size_t linelen;
-	const char *hostname, *path = NULL;
+	const char *hostname, *path = NULL, *repos_path = NULL;
 
 	if (client->cmd_done) {
 		log_warnx("%s: client sent data even though login command "
@@ -574,8 +574,13 @@ client_read(struct bufferevent *bev, void *d)
 		    !got_path_is_root_dir(srv->gotweb_url_root))
 			path = srv->gotweb_url_root;
 
-		if (evbuffer_add_printf(out, "ok https://%s%s/?login=%s\n",
-		    hostname, path ? path : "", code) == -1) {
+		if (srv->repos_url_path[0] != '\0' &&
+		    !got_path_is_root_dir(srv->repos_url_path))
+			repos_path = srv->repos_url_path;
+	
+		if (evbuffer_add_printf(out, "ok https://%s%s%s%s/?login=%s\n",
+		    hostname, path ? path : "", path ? "/" : "",
+		    repos_path ? repos_path : "", code) == -1) {
 			log_warnx("%s: evbuffer_add_printf failed", __func__);
 			client_err(bev, EVBUFFER_READ, client);
 			free(code);