feat: ignore query parameters in formatted URLs for readability
This commit is contained in:
@@ -25,6 +25,12 @@ char *pretty_display_url(const char *input) {
|
|||||||
strncpy(temp, start, sizeof(temp) - 1);
|
strncpy(temp, start, sizeof(temp) - 1);
|
||||||
temp[sizeof(temp) - 1] = '\0';
|
temp[sizeof(temp) - 1] = '\0';
|
||||||
|
|
||||||
|
char *query = strchr(temp, '?');
|
||||||
|
if (query) {
|
||||||
|
*query = '\0';
|
||||||
|
input_len = strlen(temp);
|
||||||
|
}
|
||||||
|
|
||||||
if (input_len > 0 && temp[input_len - 1] == '/') {
|
if (input_len > 0 && temp[input_len - 1] == '/') {
|
||||||
temp[input_len - 1] = '\0';
|
temp[input_len - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user