/
stop_on_redirect.patch
31 lines (28 loc) · 1.04 KB
/
stop_on_redirect.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h
index 2790f2c..3c44b30 100644
--- a/include/internal/cef_types.h
+++ b/include/internal/cef_types.h
@@ -1167,6 +1167,12 @@ typedef enum {
// originated in the browser process.
///
UR_FLAG_NO_RETRY_ON_5XX = 1 << 7,
+
+ ///
+ // If set 3xx responses will cause the fetch to halt immediately rather than
+ // continue through the redirect.
+ ///
+ UR_FLAG_STOP_ON_REDIRECT = 1 << 8,
} cef_urlrequest_flags_t;
///
diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc
index b727b46..1384e5c 100644
--- a/libcef/browser/browser_urlrequest_impl.cc
+++ b/libcef/browser/browser_urlrequest_impl.cc
@@ -292,6 +292,9 @@ class CefBrowserURLRequest::Context
if (cef_flags & UR_FLAG_NO_RETRY_ON_5XX)
fetcher_->SetAutomaticallyRetryOn5xx(false);
+ if (cef_flags & UR_FLAG_STOP_ON_REDIRECT)
+ fetcher_->SetStopOnRedirect(true);
+
int load_flags = 0;
if (cef_flags & UR_FLAG_SKIP_CACHE)