After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 613442 - Catch URIs without host passed to soup_session_prepare_for_uri
Catch URIs without host passed to soup_session_prepare_for_uri
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
: 621384 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-03-20 21:31 UTC by Xan Lopez
Modified: 2010-06-13 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
catch-no-host-prepare-for-uri.diff (1.17 KB, patch)
2010-03-20 21:33 UTC, Xan Lopez
committed Details | Review

Description Xan Lopez 2010-03-20 21:31:57 UTC
WebKit passes us URIs like that (eg, javascript:), which makes us print lots of critical warnings.
Comment 1 Xan Lopez 2010-03-20 21:33:13 UTC
Created attachment 156636 [details] [review]
catch-no-host-prepare-for-uri.diff
Comment 2 Dan Winship 2010-03-25 01:07:57 UTC
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...
Comment 3 Mario Sánchez Prada 2010-03-25 12:40:10 UTC
Adding myself to CC
Comment 4 Dan Winship 2010-03-25 13:29:33 UTC
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 5 Xan Lopez 2010-04-03 17:25:33 UTC
Comment on attachment 156636 [details] [review]
catch-no-host-prepare-for-uri.diff

Pushed this to master with the requested changes, commit 50e363db0243
Comment 6 Xan Lopez 2010-04-03 17:25:56 UTC
Closing.
Comment 7 Dan Winship 2010-06-13 21:08:22 UTC
*** Bug 621384 has been marked as a duplicate of this bug. ***