#include "requestinterceptor.h" #include RequestInterceptor::RequestInterceptor(QObject *parent) : QWebEngineUrlRequestInterceptor(parent) { } bool RequestInterceptor::shouldAllow(const QUrl &url) { // QUrl::scheme() always normalizes to lowercase (verified: QUrl("HTTP://x/y") // .scheme() == "http"), so a lowercase-literal compare cannot be bypassed // by unusual casing, in either the allow or the deny direction. const QString scheme = url.scheme(); // data: is never allowed here. It is permitted for the main-frame // document only, which is handled in interceptRequest() where the resource // type is known: a message body can put data: in or //