1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

handle HTTP URL escaping, problem reported by Glen Nakamura and Stefano

* nanhttp.c: handle HTTP URL escaping, problem reported by
  Glen Nakamura and Stefano Zacchiroli
Daniel
This commit is contained in:
Daniel Veillard 2002-12-04 11:44:48 +00:00
parent 1c732d2e10
commit 8efff67157
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Wed Dec 4 12:43:28 CET 2002 Daniel Veillard <daniel@veillard.com>
* nanhttp.c: handle HTTP URL escaping, problem reported by
Glen Nakamura and Stefano Zacchiroli
Sat Nov 30 12:19:17 CET 2002 Daniel Veillard <daniel@veillard.com>
* DOCBparser.c HTMLparser.c parser.c valid.c xpath.c: code cleanup

View File

@ -76,6 +76,7 @@
#include <libxml/parser.h> /* for xmlStr(n)casecmp() */
#include <libxml/nanohttp.h>
#include <libxml/globals.h>
#include <libxml/uri.h>
/**
* A couple portability macros
@ -371,6 +372,7 @@ xmlNanoHTTPScanProxy(const char *URL) {
static xmlNanoHTTPCtxtPtr
xmlNanoHTTPNewCtxt(const char *URL) {
xmlNanoHTTPCtxtPtr ret;
xmlChar *escaped;
ret = (xmlNanoHTTPCtxtPtr) xmlMalloc(sizeof(xmlNanoHTTPCtxt));
if (ret == NULL) return(NULL);
@ -381,7 +383,13 @@ xmlNanoHTTPNewCtxt(const char *URL) {
ret->fd = -1;
ret->ContentLength = -1;
xmlNanoHTTPScanURL(ret, URL);
escaped = xmlURIEscapeStr(BAD_CAST URL, BAD_CAST"@/:=?;#%&");
if (escaped != NULL) {
xmlNanoHTTPScanURL(ret, (const char *) escaped);
xmlFree(escaped);
} else {
xmlNanoHTTPScanURL(ret, URL);
}
return(ret);
}