]> granicus.if.org Git - libevent/commitdiff
sample: drop uri_root from base_url in http-server.
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 13 Aug 2013 14:19:50 +0000 (18:19 +0400)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 13 Aug 2013 14:19:50 +0000 (18:19 +0400)
By default there is "0.0.0.0", and this address will work only from
the same machine, and besides there is no need in uri_root in base_url,
because it will be added automatically by browser.

sample/http-server.c

index 502c45e24df47235647c697b7f8c0a3366661d88..1cb89bc91b04ed7a3ec4a84d1889ce712411cf7e 100644 (file)
@@ -248,13 +248,13 @@ send_document_cb(struct evhttp_request *req, void *arg)
 
                evbuffer_add_printf(evb, "<html>\n <head>\n"
                    "  <title>%s</title>\n"
-                   "  <base href='%s%s%s'>\n"
+                   "  <base href='%s%s'>\n"
                    " </head>\n"
                    " <body>\n"
                    "  <h1>%s</h1>\n"
                    "  <ul>\n",
                    decoded_path, /* XXX html-escape this. */
-                   uri_root, path, /* XXX html-escape this? */
+                   path, /* XXX html-escape this? */
                    trailing_slash,
                    decoded_path /* XXX html-escape this */);
 #ifdef _WIN32