cookies: Add support for Mozilla's Publix Suffix List

Use libpsl to check the domain value of Set-Cookie headers (and cookie
jar entries) for not being a Publix Suffix.

The configure script checks for "libpsl" by default. Disable the check
with --without-libpsl.

Ref: https://publicsuffix.org/
Ref: https://github.com/publicsuffix/list
Ref: https://github.com/rockdaboot/libpsl
This commit is contained in:
Tim Rühsen 2015-09-29 11:33:01 +02:00 committed by Daniel Stenberg
parent 684816cd9b
commit e77b5b7453
7 changed files with 134 additions and 1 deletions

View file

@ -40,6 +40,10 @@
#include <stringprep.h>
#endif
#ifdef USE_LIBPSL
#include <libpsl.h>
#endif
#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS)
#include <iconv.h>
#endif
@ -100,6 +104,11 @@ char *curl_version(void)
ptr += len;
}
#endif
#ifdef USE_LIBPSL
len = snprintf(ptr, left, " libpsl/%s", psl_get_version());
left -= len;
ptr += len;
#endif
#ifdef USE_WIN32_IDN
len = snprintf(ptr, left, " WinIDN");
left -= len;