Commit Graph

13 Commits (7c07bd43d2c28e7e38e7dc65375395c5e376b20d)

Author SHA1 Message Date
Ariya Hidayat 5528c046db Some API changes in the WebServer module.
Trying to match http://nodejs.org/docs/latest/api/http.html.

For the server response:

  * Change writeBody to write
  * Change writeHeaders to writeHead

For the request object, 'headers' is now an object containing all
key-value pairs of the actual HTTP headers.

'queryString' is folded into 'url' key.

Non-standard keys in the request: isSSL, remotePort, remoteIP,
remoteUser, are disabled in the mean-time (will be revisited after 1.4
release).

Implementation-wise, the request object is now a simple key-value pair
using QVariant, as opposed to the heavy QObject instance.

http://code.google.com/p/phantomjs/issues/detail?id=115
2011-12-19 18:38:21 -08:00
Ariya Hidayat f3277bc5e9 Explicitly disable directory listing in the web server.
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
2011-12-19 18:01:19 -08:00
Paul Tsier b10dc130ce Call qRegisterMetaType on mongoose types 2011-12-11 18:54:35 -08:00
Milian Wolff bd2052631f basic unit testing for WebServer.listen 2011-11-15 13:45:11 +01:00
Milian Wolff 5eaf705955 basic unit test for webserver 2011-11-15 13:45:11 +01:00
Milian Wolff 667c585424 don't deadlock, could happen on error
i.e. if we tried to listen to an already used port, the error
was propagated in the main thread and the blockingqueuedconnection
would deadlock. not anymore
2011-11-15 13:45:11 +01:00
Milian Wolff 36e8a3e87c cleanup api 2011-11-15 13:45:11 +01:00
Milian Wolff 6376ff0cb9 --debug 2011-11-15 13:45:11 +01:00
Milian Wolff a6bde751a9 extend WebServerResponse API 2011-11-15 13:45:11 +01:00
Milian Wolff 245eec551f make it possible to access the request headers 2011-11-15 13:45:11 +01:00
Milian Wolff f30bfa9fb7 extend WebServerRequest API 2011-11-15 13:45:11 +01:00
Milian Wolff 0abdc7f9ed very basic response + request handling for WebServer
the api is very limited but already makes the server.js example
do something useful with the server
2011-11-15 13:45:11 +01:00
Milian Wolff 73705e484b first work towards a WebServer
this is the minimal server that gets properly embedded into
the phantomjs space but the .listen api is missing actually
useful options (incoming request and ability to write to client)
2011-11-15 13:44:47 +01:00