summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-02 16:23:09 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-10-22 18:03:15 +0200
commit229621361562d0e89aeb5f2d2f0ace0115bf164c (patch)
tree4bf2425711971e24a83138cd20811cecf676eb33 /src/core
parentb3f9b66e6b43087873c7fc6518c0197201fd04c7 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: examples/webengine/minimal/main.cpp src/3rdparty src/core/net/url_request_custom_job.cpp tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp Change-Id: I33994024a4be5ed787800c5718a0a443b970c36d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp2
-rw-r--r--src/core/content_browser_client_qt.cpp2
-rw-r--r--src/core/net/url_request_custom_job.cpp20
3 files changed, 15 insertions, 9 deletions
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 0fddacb15..b27de4c23 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -108,7 +108,7 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
QCoreApplication *app = QCoreApplication::instance();
if (!app) {
- qFatal("QtWebEngine::initialize() must be called after the construction of the application object.");
+ qFatal("QtWebEngine::initialize() but no core application instance.");
return;
}
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 6fcd9ad5b..29b6e09ed 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -252,7 +252,7 @@ void ShareGroupQtQuick::AboutToAddFirstContext()
// This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering.
QOpenGLContext *shareContext = qt_gl_global_share_context();
if (!shareContext) {
- qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function.");
+ qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function before QCoreApplication is created.");
}
m_shareContextQtQuick = new QtShareGLContext(shareContext);
#endif
diff --git a/src/core/net/url_request_custom_job.cpp b/src/core/net/url_request_custom_job.cpp
index 56ba79f35..0e640766f 100644
--- a/src/core/net/url_request_custom_job.cpp
+++ b/src/core/net/url_request_custom_job.cpp
@@ -41,6 +41,7 @@
#include "url_request_custom_job_proxy.h"
#include "api/qwebengineurlscheme.h"
+
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
@@ -146,17 +147,22 @@ void URLRequestCustomJob::GetResponseInfo(HttpResponseInfo* info)
{
// Based on net::URLRequestRedirectJob::StartAsync()
- if (!m_corsEnabled)
+ if (m_error)
return;
std::string headers;
- headers += base::StringPrintf("HTTP/1.1 %i OK\n", m_httpStatusCode);
- if (m_redirect.is_valid())
+ if (m_redirect.is_valid()) {
+ headers += "HTTP/1.1 303 See Other\n";
headers += base::StringPrintf("Location: %s\n", m_redirect.spec().c_str());
- std::string origin;
- if (request_->extra_request_headers().GetHeader("Origin", &origin)) {
- headers += base::StringPrintf("Access-Control-Allow-Origin: %s\n", origin.c_str());
- headers += "Access-Control-Allow-Credentials: true\n";
+ } else {
+ headers += base::StringPrintf("HTTP/1.1 %i OK\n", m_httpStatusCode);
+ }
+ if (m_corsEnabled) {
+ std::string origin;
+ if (request_->extra_request_headers().GetHeader("Origin", &origin)) {
+ headers += base::StringPrintf("Access-Control-Allow-Origin: %s\n", origin.c_str());
+ headers += "Access-Control-Allow-Credentials: true\n";
+ }
}
info->headers = new HttpResponseHeaders(HttpUtil::AssembleRawHeaders(headers));