GNOME Bugzilla – Bug 613442
Catch URIs without host passed to soup_session_prepare_for_uri
Last modified: 2010-06-13 21:08:22 UTC
WebKit passes us URIs like that (eg, javascript:), which makes us print lots of critical warnings.
Created attachment 156636 [details] [review] catch-no-host-prepare-for-uri.diff
Comment on attachment 156636 [details] [review] catch-no-host-prepare-for-uri.diff SoupSession doesn't deal with non-http URIs though, and soup_message_new() will return NULL if you pass it a URI with no host (though oddly, soup_message_new_from_uri() won't...). But anyway, it seems a little odd to have prepare_uri() silently accept URIs that queue_message() wouldn't. Maybe WebKit should just check SOUP_URI_VALID_FOR_HTTP(uri) before calling prepare_uri? (I'm willing to be convinced otherwise.) adding g_return_if_fails of some sort here is good, though it should be SOUP_IS_SESSION (session), not session != NULL. (And possibly SOUP_URI_VALID_FOR_HTTP (uri) instead of uri != NULL.) hard freeze, so you can't commit anything right now anyway...
Adding myself to CC
Comment on attachment 156636 [details] [review] catch-no-host-prepare-for-uri.diff actually, i'm wrong. after we merge new-io, we'll want to pass ftp, etc, URIs to libsoup too. So just fix >+ g_return_if_fail (session != NULL); to use SOUP_IS_SESSION and it's good to go (post-freeze).
Comment on attachment 156636 [details] [review] catch-no-host-prepare-for-uri.diff Pushed this to master with the requested changes, commit 50e363db0243
Closing.
*** Bug 621384 has been marked as a duplicate of this bug. ***