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.
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.
Turns Response into a QObject and sets parent to the
command that emits it.
Each Command is also a child of the decorator commands,
Timeout and PageLoading commnds, so that deleting the
top level command will delete all the children.
See discussion in #430.
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.