From 859f81cdd792072cc2d1cab136a907274965be8d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 13 Mar 2015 18:12:31 -0700 Subject: [PATCH 1/4] some & squishes missed in review --- interface/src/ui/DataWebPage.cpp | 2 +- interface/src/ui/DataWebPage.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/DataWebPage.cpp b/interface/src/ui/DataWebPage.cpp index de97ab94a6..2aa5cfdb8a 100644 --- a/interface/src/ui/DataWebPage.cpp +++ b/interface/src/ui/DataWebPage.cpp @@ -47,6 +47,6 @@ bool DataWebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkReques } } -QString DataWebPage::userAgentForUrl(const QUrl & url) const { +QString DataWebPage::userAgentForUrl(const QUrl& url) const { return INTERFACE_USER_AGENT; } diff --git a/interface/src/ui/DataWebPage.h b/interface/src/ui/DataWebPage.h index 03c6781d05..a9349f1d5f 100644 --- a/interface/src/ui/DataWebPage.h +++ b/interface/src/ui/DataWebPage.h @@ -22,7 +22,7 @@ public: protected: void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID); bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, QWebPage::NavigationType type); - virtual QString userAgentForUrl(const QUrl & url) const; + virtual QString userAgentForUrl(const QUrl& url) const; }; #endif // hifi_DataWebPage_h From dcff4f59563e1e91fe4348d8e08ad0fbcd5deb38 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 13 Mar 2015 18:25:17 -0700 Subject: [PATCH 2/4] use HIGH_FIDELITY_USER_AGENT for DataWebPage --- interface/src/ui/DataWebPage.cpp | 2 +- interface/src/ui/DataWebPage.h | 2 -- libraries/shared/src/SharedUtil.h | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/interface/src/ui/DataWebPage.cpp b/interface/src/ui/DataWebPage.cpp index 2aa5cfdb8a..bec2c98f55 100644 --- a/interface/src/ui/DataWebPage.cpp +++ b/interface/src/ui/DataWebPage.cpp @@ -48,5 +48,5 @@ bool DataWebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkReques } QString DataWebPage::userAgentForUrl(const QUrl& url) const { - return INTERFACE_USER_AGENT; + return HIGH_FIDELITY_USER_AGENT; } diff --git a/interface/src/ui/DataWebPage.h b/interface/src/ui/DataWebPage.h index a9349f1d5f..c1c343a216 100644 --- a/interface/src/ui/DataWebPage.h +++ b/interface/src/ui/DataWebPage.h @@ -14,8 +14,6 @@ #include -const QString INTERFACE_USER_AGENT = "HighFidelityInterface/1.0"; - class DataWebPage : public QWebPage { public: DataWebPage(QObject* parent = 0); diff --git a/libraries/shared/src/SharedUtil.h b/libraries/shared/src/SharedUtil.h index f09ff9bd72..ba3e1b628b 100644 --- a/libraries/shared/src/SharedUtil.h +++ b/libraries/shared/src/SharedUtil.h @@ -68,7 +68,7 @@ static const quint64 USECS_PER_SECOND = USECS_PER_MSEC * MSECS_PER_SECOND; const int BITS_IN_BYTE = 8; // Use a custom User-Agent to avoid ModSecurity filtering, e.g. by hosting providers. -const QByteArray HIGH_FIDELITY_USER_AGENT = "Mozilla/5.0 (HighFidelity)"; +const QByteArray HIGH_FIDELITY_USER_AGENT = "HighFidelity/1.0"; quint64 usecTimestampNow(bool wantDebug = false); void usecTimestampNowForceClockSkew(int clockSkew); From 9f7ed7b12a5782764a330f231d1fd9e950652601 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 13 Mar 2015 18:28:09 -0700 Subject: [PATCH 3/4] update user agent to be HighFidelityInterface --- libraries/shared/src/SharedUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/SharedUtil.h b/libraries/shared/src/SharedUtil.h index ba3e1b628b..2bdab3e1a5 100644 --- a/libraries/shared/src/SharedUtil.h +++ b/libraries/shared/src/SharedUtil.h @@ -68,7 +68,7 @@ static const quint64 USECS_PER_SECOND = USECS_PER_MSEC * MSECS_PER_SECOND; const int BITS_IN_BYTE = 8; // Use a custom User-Agent to avoid ModSecurity filtering, e.g. by hosting providers. -const QByteArray HIGH_FIDELITY_USER_AGENT = "HighFidelity/1.0"; +const QByteArray HIGH_FIDELITY_USER_AGENT = "HighFidelityInterface/1.0"; quint64 usecTimestampNow(bool wantDebug = false); void usecTimestampNowForceClockSkew(int clockSkew); From 9d055f81f43b6e3f58b0d62d03c7571277df150c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 13 Mar 2015 18:29:55 -0700 Subject: [PATCH 4/4] use a Mozilla user agent for mod security --- libraries/shared/src/SharedUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/SharedUtil.h b/libraries/shared/src/SharedUtil.h index 2bdab3e1a5..9cf76dd1dc 100644 --- a/libraries/shared/src/SharedUtil.h +++ b/libraries/shared/src/SharedUtil.h @@ -68,7 +68,7 @@ static const quint64 USECS_PER_SECOND = USECS_PER_MSEC * MSECS_PER_SECOND; const int BITS_IN_BYTE = 8; // Use a custom User-Agent to avoid ModSecurity filtering, e.g. by hosting providers. -const QByteArray HIGH_FIDELITY_USER_AGENT = "HighFidelityInterface/1.0"; +const QByteArray HIGH_FIDELITY_USER_AGENT = "Mozilla/5.0 (HighFidelityInterface)"; quint64 usecTimestampNow(bool wantDebug = false); void usecTimestampNowForceClockSkew(int clockSkew);