Commit 8efff671 authored by Daniel Veillard's avatar Daniel Veillard

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
parent 1c732d2e
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
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment