Commit Graph

15 Commits

Author SHA1 Message Date
Joe Ferris 82d0d6fcc9 Extract handle classes from NetworkAccessManager
NetworkAccessManager was getting pretty complex, and adding something
that modifies or intercepts requests is becoming a common change.

This change introduces a chain of handlers which can modify a request or
return a response of their own.

To start with, this extracts the concerns of fixing missing content
types, setting custom headers, and intercepting blacklisted requests.
2014-11-24 09:52:34 -05:00
youpy d264f40f88 Blacklisting can use wildcard patterns 2014-08-18 12:37:28 -04:00
Joe Ferris b5ca7e6057 Fix OS X keychain bug in Qt 5
* Performing basic auth would pop up a keychain dialog
* Pressing "Accept" resulted in an infinite loop
2013-11-10 16:52:42 -05:00
Matthew Horan be22bfe244 Share the NetworkAccessManager across WebPages
Destroying the NetworkAccessManager seems to result in "terminate called
without an active exception" segfaults. The documentation states that an
application requires only a single single NetworkAccessManager.
2013-03-18 08:14:35 -04:00
Matthew Horan 410f4e78c6 Driver#html returns raw data for non-HTML content
The behavior of QWebFrame::toPlainText is undefined if the content
contains non-Latin1 characters. In Qt 5, additional MIME types are
considered supported, so there's no way to get at the raw data when
unsupported content has been loaded. Instead, proxy network replies
through NetworkReplyProxy which provides repetitive reads.
2013-03-11 23:50:48 -04:00
Matthew Horan b829103bbd Set the URL of NoOpReply to the request URL
Prevents insertion of an empty URL into m_responses when the requested
URL is blacklisted.
2012-11-30 21:37:56 -05:00
Matthew Horan 5127c01366 Fix status code and headers for iframes
QWebFrame::url() does not return a valid URL for iframes.  We can't just
look up the requested URL in m_responses because the request may have
been redirected, so instead we keep track of redirects and set up the
NetworkResponse when the final reply is received.
2012-11-30 21:26:40 -05:00
Sean Geoghegan f755b1f277 Add blacklisting support to webkit server.
Adds a SetBlacklist command that takes a list of URLs
which will be black listed by the WebKit Server. When
a request is made to one these URLs webkit_server will
intercept the request and return a NoOpReply which contains
no content.
2012-11-15 10:32:06 -05:00
Matthew Horan e9a4b77ecb Read status and headers from response after load 2012-10-23 23:24:42 -04:00
Joe Ferris cae5119eef Fix issues with Qt 4.8 2012-10-23 21:00:50 -04:00
Matthew Mongeau 784b9b7f63 Setup multi-window sync. 2012-06-29 10:43:50 -04:00
Matthew Mongeau 5b5067f243 Added browser.authenticate for http basic authentication 2012-06-15 12:49:02 -04:00
Patrick Bacon f190f51652 Rather than creating a new NetworkAccessManager when the page is reset,
reuse the existing manager and just clear its headers and cookies.

This avoids repeatedly setting up the SIGNAL/SLOT callback stuff which
is leading to unclosed pipes on Ubuntu, eventually causing "too many
open files" errors in large test suites.
2012-04-03 18:39:10 -04:00
os0x 818f654e4e fix spell
move header specs to driver_spec
2011-06-25 20:48:01 +09:00
shogo-ohta ee1388e329 add header support 2011-06-24 13:55:03 +09:00