Skip to content

Commit

Permalink
Set site root to / when site root is empty string (#721)
Browse files Browse the repository at this point in the history
Co-authored-by: 杨赫然 <[email protected]>
  • Loading branch information
feiniks and 杨赫然 authored Dec 5, 2024
1 parent 968b228 commit 04e190c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/seafile-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,17 @@ load_config (SeafileSession *session, const char *config_file_path)
ret = -1;
goto out;
}
if (notif_enabled && notif_server != NULL) {
if (notif_enabled && notif_server != NULL) {
session->notif_server_private_key = g_strdup (private_key);
char notif_url[128];
g_sprintf (notif_url, "%s:%d", notif_server, notif_port);
session->notif_url = g_strdup (notif_url);
}
session->seahub_pk = g_strdup (private_key);
if (site_root) {
session->seahub_url = g_strdup_printf("http://127.0.0.1:8000%sapi/v2.1/internal", site_root);
} else {
session->seahub_url = g_strdup("http://127.0.0.1:8000/api/v2.1/internal");
if (!site_root || g_strcmp0 (site_root, "") == 0) {
site_root = "/";
}
session->seahub_url = g_strdup_printf("http://127.0.0.1:8000%sapi/v2.1/internal", site_root);
session->seahub_conn_pool = connection_pool_new ();

if (g_strcmp0 (log_to_stdout, "true") == 0) {
Expand Down

0 comments on commit 04e190c

Please sign in to comment.