Verified Commit 5edf9c0a authored by James Westman's avatar James Westman
Browse files

network-tile-source: Throw error if URL is invalid

parent b205a460
......@@ -873,6 +873,14 @@ on_file_cache_get_tile (GObject *source_object, GAsyncResult *res, gpointer user
data->cached_data = g_bytes_ref (bytes);
data->msg = soup_message_new (SOUP_METHOD_GET, uri);
if (data->msg == NULL)
{
g_task_return_new_error (task, SHUMATE_NETWORK_SOURCE_ERROR,
SHUMATE_NETWORK_SOURCE_ERROR_MALFORMED_URL,
"The URL %s is not valid", uri);
return;
}
if (etag)
{
g_autofree char *date = get_modified_time_string (data->tile);
......
......@@ -53,6 +53,7 @@ typedef enum {
SHUMATE_NETWORK_SOURCE_ERROR_FAILED,
SHUMATE_NETWORK_SOURCE_ERROR_BAD_RESPONSE,
SHUMATE_NETWORK_SOURCE_ERROR_COULD_NOT_CONNECT,
SHUMATE_NETWORK_SOURCE_ERROR_MALFORMED_URL,
SHUMATE_NETWORK_SOURCE_ERROR_OFFLINE,
} ShumateNetworkSourceError;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment