[xml] nanohttp: No redirects for http://www.domain.com



In the latest libXml 2.7.5, nanohttp no longer redirect URLs with an empty path (no terminal '/') like this:

  http://www.domain.com
  http://www.google.com

Compared to previous versions, I observed that in nanohttp.c, the following code does no longer trigger 
because uri->path is not NULL but contains an empty string:

    if (uri->path != NULL)
        ctxt->path = xmlMemStrdup(uri->path);
    else
        ctxt->path = xmlMemStrdup("/");

I am not sure which change causes the problem, but since nanohttp.c has not changed in this regard I believe 
that the problem is in uri.c, which has changed a lot since the update to RFC 3986.

In particular, the uri.c function xmlParse3986PathAbEmpty() copies an empty string to uri->path in:

  uri->path = STRNDUP(*str, cur - *str);

Similar code is scattered in different places.

Is this intentional?

Ralf




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]