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 602389 - Function soup_cookies_from_request() causes failure of assertion (domain != NULL)
Function soup_cookies_from_request() causes failure of assertion (domain != N...
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-11-19 09:36 UTC by Sergey I. Sharybin
Modified: 2009-11-21 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sergey I. Sharybin 2009-11-19 09:36:01 UTC
Hi,

When I use function soup_cookies_from_request() to get cookies from request message headers, I've got such warnings in my stderr:

libsoup-WARNING **: (soup-cookie.c:443):soup_cookie_new: runtime check failed: (domain != NULL)

I think this is because client sends to server only cookie's name and value without information about cookie expiration, domain and path and because this, function soup_cookies_from_request() calls soup_cookie_new() to create new cookie descriptor with NULL for path, domain and zero for expiration. And such calling prints warning to stderr.

And I think denying of empty domain is not totally correct. I don't know theory of cookies very well, but there is some difficulties to use cookies with localhost. Localhost domain is not correct for cookies, and I could solve this problem by creating Set-Cookie header myself, where I do not set a domain property at all.

Maybe it would be better to remove domain assertion from soup_cookie_new() and when programmer applies cookies to response (i.e. by calling soup_cookies_to_response()) for NULL-domained cookies a 'domain' property wouldn't send? This should solve the both problems I wrote about.

Thanks and sorry for my English
Comment 1 Dan Winship 2009-11-21 14:55:07 UTC
fixed in git. will be in libsoup 2.28.2 in a few weeks. thanks for the
bug report