Giter Site home page Giter Site logo

Comments (8)

m6w6 avatar m6w6 commented on August 15, 2024

bagder: setting verbose to curl will of course tell if it rejects cookies based on PSL

I'll give that a try when I come around building a libcurl with libpsl support.

from ext-http.

bagder avatar bagder commented on August 15, 2024

From what I can tell, the latest public suffix list is this: https://github.com/publicsuffix/list/blob/master/public_suffix_list.dat and it doesn't contain "localhost" as far as I can see, so that explanation is puzzling to me.

from ext-http.

remicollet avatar remicollet commented on August 15, 2024

IIRC reading https://github.com/rockdaboot/libpsl/blob/master/src/psl.c#L790

Suffix without any dot (suffix.nlabels == 1) are considered as public...

from ext-http.

m6w6 avatar m6w6 commented on August 15, 2024

Yup.

<m6w6> okay: `cookie 'counter' dropped, domain 'localhost' is a public suffix`
<bagder> ah ok
<m6w6> https://github.com/rockdaboot/libpsl/blob/master/src/psl.c#L810
<bagder> so it says any TLD is PSL if there's only one part?
<m6w6> seems so
<bagder> that seems wrong
<bagder> I mean, you could argue that you should treat cookies in some way in that case, but saying that it is a PSL must be wrong
<bagder> surprising at least
<m6w6> yup

So either curl's usage of psl is too naive, or one could consider it a bug, that psl treats everything being just a single label as TLD.

from ext-http.

kdudka avatar kdudka commented on August 15, 2024

I am not sure if it is already attached -- this is the minimal example I have tried:

#if 0
gcc -lpsl $0 || exit $?
./a.out
exit $?
#endif

#include <libpsl.h>
#include <stdio.h>

static const char domain[] = "localhost";

int main()
{
    const psl_ctx_t *psl = psl_builtin();
    if (!psl)
        return 1;

    printf("psl_is_public_suffix(psl, \"%s\") = %d\n", domain,
            psl_is_public_suffix(psl, domain));

    return 0;
}

I do not know libpsl enough to tell whether it is a bug or intended behavior.

from ext-http.

m6w6 avatar m6w6 commented on August 15, 2024

Yeah, I'm not sure, either. See rockdaboot/libpsl#48

from ext-http.

m6w6 avatar m6w6 commented on August 15, 2024

Fixed in libcurl IIRC.

from ext-http.

kdudka avatar kdudka commented on August 15, 2024

Yes, this was fixed via: curl/curl@curl-7_47_1-103-gc140bd7

from ext-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.