Some apps(like Premium Play) which get cookie through xhr.getAllResponseHeaders.
Currently blink don't disclose response header with Set-Cookie field
to XMLHttpRequest.
wrtjs call SetDiscloseSetCookieEnabled to implement the function.
ewk_settings api does not delete avoid native app call the ewk api.
Reference:
- https://review.tizen.org/gerrit/293944/
Change-Id: I6b84ffbffdb9072df23d242b7cdb3b021bdf2ddb
Signed-off-by: jiangyuwei <yuwei.jiang@samsung.com>
const char HttpResponseHeaders::kLastModified[] = "Last-Modified";
const char HttpResponseHeaders::kVary[] = "Vary";
+#if BUILDFLAG(IS_TIZEN_TV)
+bool HttpResponseHeaders::disclose_set_cookie_enabled_ = false;
+#endif
+
struct HttpResponseHeaders::ParsedHeader {
// A header "continuation" contains only a subsequent value for the
// preceding header. (Header values are comma separated.)
// with |PERSIST_SANS_COOKIES|.
static bool IsCookieResponseHeader(base::StringPiece name);
+#if BUILDFLAG(IS_TIZEN_TV)
+ static void SetDiscloseSetCookieEnabled(bool value) {
+ disclose_set_cookie_enabled_ = value;
+ }
+
+ static bool DiscloseSetCookieEnabled() {
+ return disclose_set_cookie_enabled_;
+ }
+#endif
+
// Write a representation of this object into tracing proto.
void WriteIntoTrace(perfetto::TracedValue context) const;
// The normalized http version (consistent with what GetStatusLine() returns).
HttpVersion http_version_;
+
+#if BUILDFLAG(IS_TIZEN_TV)
+ static bool disclose_set_cookie_enabled_;
+#endif
};
using ResponseHeadersCallback =
const param_type& p) {
WriteParam(m, p.get() != nullptr);
if (p.get()) {
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (net::HttpResponseHeaders::DiscloseSetCookieEnabled()) {
+ LOG(INFO) << "disclose Set-Cookie headers over IPC";
+ p->Persist(m, net::HttpResponseHeaders::PERSIST_ALL);
+ return;
+ }
+#endif
// Do not disclose Set-Cookie headers over IPC.
p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES);
}
void ewk_settings_disclose_set_cookie_headers_enabled(Ewk_Settings* settings, Eina_Bool Enabled)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ EINA_SAFETY_ON_NULL_RETURN(settings);
+ net::HttpResponseHeaders::SetDiscloseSetCookieEnabled(!!Enabled);
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV");
+#endif
}
Eina_Bool ewk_settings_mixed_contents_set(const Ewk_Settings* settings, Eina_Bool allow)