Navigation Menu

Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Explicitly disable directory listing in the web server.
Browse files Browse the repository at this point in the history
This is for security, as leaking the directory structure is likely not
the use case of PhantomJS built-in server.

http://code.google.com/p/phantomjs/issues/detail?id=115
  • Loading branch information
ariya committed Dec 20, 2011
1 parent feafb4f commit f3277bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/webserver.cpp
Expand Up @@ -83,7 +83,10 @@ bool WebServer::listenOnPort(const QString& port)
///TODO: listen on multiple ports?
close();

const char *options[] = {"listening_ports", qstrdup(qPrintable(port)), NULL};
const char *options[] = {
"listening_ports", qstrdup(qPrintable(port)),
"enable_directory_listing", "no",
NULL};
///TODO: more options from m_config?
m_ctx = mg_start(&callback, this, options);
if (!m_ctx) {
Expand Down

0 comments on commit f3277bc

Please sign in to comment.