mirror of https://github.com/vitalif/phantomjs
Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Ariya Hidayat | 67a9e77770 | |
Ariya Hidayat | 77a23343e5 | |
Ivan De Marino | cb02a3340f | |
Ariya Hidayat | 266a12bc11 | |
Ivan De Marino | abd7f73ee5 | |
Ariya Hidayat | 5a2f4879e8 |
|
@ -27,7 +27,9 @@ Please see also http://code.google.com/p/phantomjs/wiki/ReleaseNotes.
|
||||||
* Fixed the web server instance to be asynchronous (issue 326) and still support Keep Alive (issue 416)
|
* Fixed the web server instance to be asynchronous (issue 326) and still support Keep Alive (issue 416)
|
||||||
* Workaround Qt 4.8.0 crash due to empty URL scheme (issue 365)
|
* Workaround Qt 4.8.0 crash due to empty URL scheme (issue 365)
|
||||||
* Fixed a Content-Type problem where POST does not work (issue 337)
|
* Fixed a Content-Type problem where POST does not work (issue 337)
|
||||||
|
* Fixed reading body request in the web server even without specific Content-Type (issue 439)
|
||||||
* Fixed Jasmine test runner with Jasmine 1.1 (issue 402)
|
* Fixed Jasmine test runner with Jasmine 1.1 (issue 402)
|
||||||
|
* Fixed request URL formatting in the web server (issue 437)
|
||||||
* Don't display debugging and warning messages (issue 323)
|
* Don't display debugging and warning messages (issue 323)
|
||||||
|
|
||||||
2011-12-31: Version 1.4.1
|
2011-12-31: Version 1.4.1
|
||||||
|
|
|
@ -28,6 +28,6 @@ Do not forget to consult the concise [API Reference](http://code.google.com/p/ph
|
||||||
|
|
||||||
PhantomJS is based on [Qt](http://qt.nokia.com).
|
PhantomJS is based on [Qt](http://qt.nokia.com).
|
||||||
|
|
||||||
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.4 ("Glory of the Snow").
|
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.5 ("Ghost Flower").
|
||||||
|
|
||||||
If you want to contribute, please read the [Contribution Guide](http://code.google.com/p/phantomjs/wiki/ContributionGuide).
|
If you want to contribute, please read the [Contribution Guide](http://code.google.com/p/phantomjs/wiki/ContributionGuide).
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
phantomjs (1.3-1~git20110703) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial release.
|
|
||||||
|
|
||||||
-- Dennis Kaarsemaker <dennis@kaarsemaker.net> Sun, 03 Jul 2011 20:45:52 +0200
|
|
|
@ -1 +0,0 @@
|
||||||
7
|
|
|
@ -1,24 +0,0 @@
|
||||||
Source: phantomjs
|
|
||||||
Section: python
|
|
||||||
Priority: extra
|
|
||||||
Maintainer: Dennis Kaarsemaker <dennis@kaarsemaker.net>
|
|
||||||
Build-Depends: debhelper (>= 7), libqt4-dev (>= 4.6), libqtwebkit-dev, qt4-qmake, python-support (>= 0.6.4), python-all-dev (>= 2.5), python-qt4-dev, python-qt4
|
|
||||||
Standards-Version: 3.8.4
|
|
||||||
XS-Python-Version: >= 2.6
|
|
||||||
Vcs-Git: http://github.com/ariya/phantomjs
|
|
||||||
|
|
||||||
Package: phantomjs
|
|
||||||
Architecture: any
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Description: phantomjs - minimalistic headless WebKit-based JavaScript-driven tool
|
|
||||||
PhantomJS is a minimalistic, headless, WebKit-based, JavaScript-driven tool.
|
|
||||||
PhantomJs has native support for different web technologies: DOM handling,
|
|
||||||
CSS selector, JSON, Canvas, SVG, and of course JavaScript.
|
|
||||||
|
|
||||||
Package: python-pyphantomjs
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-qt4, python-argparse
|
|
||||||
Description: phantomjs - minimalistic headless WebKit-based JavaScript-driven tool
|
|
||||||
PhantomJS is a minimalistic, headless, WebKit-based, JavaScript-driven tool.
|
|
||||||
PhantomJs has native support for different web technologies: DOM handling,
|
|
||||||
CSS selector, JSON, Canvas, SVG, and of course JavaScript.
|
|
|
@ -1,35 +0,0 @@
|
||||||
Format-Specification: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=174&view=co&pathrev=174
|
|
||||||
Name: phantomjs
|
|
||||||
Maintainer: Dennis Kaarsemaker <dennis@kaarsemaker.net>
|
|
||||||
Source: http://github.com/ariya/phantomjs
|
|
||||||
|
|
||||||
Copyright: 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
||||||
License: BSD-3-clause
|
|
||||||
|
|
||||||
Files: debian/*
|
|
||||||
Copyright: 2011 Dennis Kaarsemaker <dennis@kaarsemaker.net>
|
|
||||||
License: BSD-3-clause
|
|
||||||
|
|
||||||
License: BSD-3-clause
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
.
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
* Neither the name of the <organization> nor the
|
|
||||||
names of its contributors may be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
.
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
||||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
@ -1,2 +0,0 @@
|
||||||
README.md
|
|
||||||
examples
|
|
|
@ -1 +0,0 @@
|
||||||
debian/tmp/usr/bin/phantomjs
|
|
|
@ -1 +0,0 @@
|
||||||
python/README.md
|
|
|
@ -1,2 +0,0 @@
|
||||||
debian/tmp/usr/bin/pyphantomjs
|
|
||||||
debian/tmp/usr/lib
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@
|
|
||||||
|
|
||||||
override_dh_auto_build:
|
|
||||||
qmake-qt4
|
|
||||||
$(MAKE)
|
|
||||||
cd python && python setup.py build
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
$(MAKE) install
|
|
||||||
mkdir -p debian/tmp/usr/bin
|
|
||||||
cp bin/* debian/tmp/usr/bin
|
|
||||||
cd python && python setup.py install --root=../debian/tmp --install-layout=deb
|
|
||||||
|
|
||||||
override_dh_auto_clean:
|
|
||||||
if [ -f Makefile ]; then $(MAKE) distclean; fi
|
|
||||||
cd python && python setup.py clean
|
|
|
@ -1 +0,0 @@
|
||||||
1.0
|
|
|
@ -127,7 +127,7 @@ exports.create = function (opts) {
|
||||||
|
|
||||||
defineSetter("onError", "javaScriptErrorSent");
|
defineSetter("onError", "javaScriptErrorSent");
|
||||||
|
|
||||||
page.onError = phantom.defaultErrorHandler;
|
// page.onError = phantom.defaultErrorHandler;
|
||||||
|
|
||||||
page.open = function (url, arg1, arg2, arg3, arg4) {
|
page.open = function (url, arg1, arg2, arg3, arg4) {
|
||||||
if (arguments.length === 1) {
|
if (arguments.length === 1) {
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
namespace UrlEncodedParser {
|
namespace UrlEncodedParser {
|
||||||
|
|
||||||
|
@ -172,7 +173,7 @@ bool WebServer::handleRequest(mg_event event, mg_connection *conn, const mg_requ
|
||||||
|
|
||||||
QByteArray uri(request->uri);
|
QByteArray uri(request->uri);
|
||||||
if (uri.startsWith('/'))
|
if (uri.startsWith('/'))
|
||||||
uri = '/' + QUrl::toPercentEncoding(QString::fromLatin1(request->uri + 1));
|
uri = '/' + QUrl::toPercentEncoding(QString::fromLatin1(request->uri + 1), "/?&#");
|
||||||
if (request->query_string)
|
if (request->query_string)
|
||||||
uri.append('?').append(QByteArray(request->query_string));
|
uri.append('?').append(QByteArray(request->query_string));
|
||||||
requestObject["url"] = uri.data();
|
requestObject["url"] = uri.data();
|
||||||
|
@ -204,9 +205,12 @@ bool WebServer::handleRequest(mg_event event, mg_connection *conn, const mg_requ
|
||||||
char * data = new char[contentLength];
|
char * data = new char[contentLength];
|
||||||
int read = mg_read(conn, data, contentLength);
|
int read = mg_read(conn, data, contentLength);
|
||||||
QByteArray rawData(data, read);
|
QByteArray rawData(data, read);
|
||||||
requestObject["rawData"] = rawData;
|
requestObject["rawData"] = QVariant(rawData);
|
||||||
|
// Check if the 'Content-Type' requires decoding
|
||||||
if (headersObject["Content-Type"] == "application/x-www-form-urlencoded") {
|
if (headersObject["Content-Type"] == "application/x-www-form-urlencoded") {
|
||||||
requestObject["post"] = UrlEncodedParser::parse(rawData);
|
requestObject["post"] = UrlEncodedParser::parse(rawData);
|
||||||
|
} else {
|
||||||
|
requestObject["post"] = QVariant(rawData);
|
||||||
}
|
}
|
||||||
delete[] data;
|
delete[] data;
|
||||||
}
|
}
|
||||||
|
@ -372,6 +376,7 @@ void WebServerResponse::writeHead(int statusCode, const QVariantMap &headers)
|
||||||
mg_printf(m_conn, "HTTP/1.1 %d %s\r\n", m_statusCode, responseCodeString(m_statusCode));
|
mg_printf(m_conn, "HTTP/1.1 %d %s\r\n", m_statusCode, responseCodeString(m_statusCode));
|
||||||
QVariantMap::const_iterator it = headers.constBegin();
|
QVariantMap::const_iterator it = headers.constBegin();
|
||||||
while(it != headers.constEnd()) {
|
while(it != headers.constEnd()) {
|
||||||
|
qDebug() << "Response Header key:" << it.key() << "value:" << it.value().toString();
|
||||||
mg_printf(m_conn, "%s: %s\r\n", qPrintable(it.key()), qPrintable(it.value().toString()));
|
mg_printf(m_conn, "%s: %s\r\n", qPrintable(it.key()), qPrintable(it.value().toString()));
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue