Skip to content

Commit

Permalink
Make sure that url->path is at least '/'
Browse files Browse the repository at this point in the history
wiby.me was failing on form submissions, because of
wiby.me?key=val
being shown instead of
wiby.me/?key=val
  • Loading branch information
w00fpack committed Nov 4, 2021
1 parent e5d9be8 commit bd50718
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ char *a_Url_str(const DilloUrl *u)

dReturn_val_if_fail (url != NULL, NULL);

url->path = (! url->path) ? "/" : url->path; // Make sure that the path is at least "/"

if (!url->url_string) {
url->url_string = dStr_sized_new(60);
dStr_sprintf(
Expand Down Expand Up @@ -442,7 +444,7 @@ DilloUrl* a_Url_new(const char *url_str, const char *base_url)
strcpy((char *)url->authority + len-2, "443");
}
}

dStr_free(url->url_string, TRUE);
url->url_string = NULL;
}
Expand Down

0 comments on commit bd50718

Please sign in to comment.