mirror of
https://github.com/overte-org/overte.git
synced 2025-06-25 19:29:51 +02:00
Merge pull request #12692 from highfidelity/stable
Merge stable back into master
This commit is contained in:
commit
feec59655c
5 changed files with 25 additions and 17 deletions
|
@ -2,7 +2,7 @@ if (typeof Settings === "undefined") {
|
||||||
Settings = {};
|
Settings = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(Settings, {
|
$.extend(Settings, {
|
||||||
DEPRECATED_CLASS: 'deprecated-setting',
|
DEPRECATED_CLASS: 'deprecated-setting',
|
||||||
TRIGGER_CHANGE_CLASS: 'trigger-change',
|
TRIGGER_CHANGE_CLASS: 'trigger-change',
|
||||||
DATA_ROW_CLASS: 'value-row',
|
DATA_ROW_CLASS: 'value-row',
|
||||||
|
|
|
@ -2222,7 +2222,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
const QString ASSIGNMENT_INSTANCES_HEADER = "ASSIGNMENT-INSTANCES";
|
const QString ASSIGNMENT_INSTANCES_HEADER = "ASSIGNMENT-INSTANCES";
|
||||||
const QString ASSIGNMENT_POOL_HEADER = "ASSIGNMENT-POOL";
|
const QString ASSIGNMENT_POOL_HEADER = "ASSIGNMENT-POOL";
|
||||||
|
|
||||||
QByteArray assignmentInstancesValue = connection->requestHeaders().value(ASSIGNMENT_INSTANCES_HEADER.toLocal8Bit());
|
QByteArray assignmentInstancesValue = connection->requestHeader(ASSIGNMENT_INSTANCES_HEADER.toLocal8Bit());
|
||||||
|
|
||||||
int numInstances = 1;
|
int numInstances = 1;
|
||||||
|
|
||||||
|
@ -2234,7 +2234,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
}
|
}
|
||||||
|
|
||||||
QString assignmentPool = emptyPool;
|
QString assignmentPool = emptyPool;
|
||||||
QByteArray assignmentPoolValue = connection->requestHeaders().value(ASSIGNMENT_POOL_HEADER.toLocal8Bit());
|
QByteArray assignmentPoolValue = connection->requestHeader(ASSIGNMENT_POOL_HEADER.toLocal8Bit());
|
||||||
|
|
||||||
if (!assignmentPoolValue.isEmpty()) {
|
if (!assignmentPoolValue.isEmpty()) {
|
||||||
// specific pool requested, set that on the created assignment
|
// specific pool requested, set that on the created assignment
|
||||||
|
@ -2632,7 +2632,7 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl
|
||||||
|
|
||||||
if (!_oauthProviderURL.isEmpty()
|
if (!_oauthProviderURL.isEmpty()
|
||||||
&& (adminUsersVariant.isValid() || adminRolesVariant.isValid())) {
|
&& (adminUsersVariant.isValid() || adminRolesVariant.isValid())) {
|
||||||
QString cookieString = connection->requestHeaders().value(HTTP_COOKIE_HEADER_KEY);
|
QString cookieString = connection->requestHeader(HTTP_COOKIE_HEADER_KEY);
|
||||||
|
|
||||||
const QString COOKIE_UUID_REGEX_STRING = HIFI_SESSION_COOKIE_KEY + "=([\\d\\w-]+)($|;)";
|
const QString COOKIE_UUID_REGEX_STRING = HIFI_SESSION_COOKIE_KEY + "=([\\d\\w-]+)($|;)";
|
||||||
QRegExp cookieUUIDRegex(COOKIE_UUID_REGEX_STRING);
|
QRegExp cookieUUIDRegex(COOKIE_UUID_REGEX_STRING);
|
||||||
|
@ -2677,7 +2677,7 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl
|
||||||
static const QByteArray REQUESTED_WITH_HEADER = "X-Requested-With";
|
static const QByteArray REQUESTED_WITH_HEADER = "X-Requested-With";
|
||||||
static const QString XML_REQUESTED_WITH = "XMLHttpRequest";
|
static const QString XML_REQUESTED_WITH = "XMLHttpRequest";
|
||||||
|
|
||||||
if (connection->requestHeaders().value(REQUESTED_WITH_HEADER) == XML_REQUESTED_WITH) {
|
if (connection->requestHeader(REQUESTED_WITH_HEADER) == XML_REQUESTED_WITH) {
|
||||||
// unauthorized XHR requests get a 401 and not a 302, since there isn't an XHR
|
// unauthorized XHR requests get a 401 and not a 302, since there isn't an XHR
|
||||||
// path to OAuth authorize
|
// path to OAuth authorize
|
||||||
connection->respond(HTTPConnection::StatusCode401, UNAUTHENTICATED_BODY);
|
connection->respond(HTTPConnection::StatusCode401, UNAUTHENTICATED_BODY);
|
||||||
|
@ -2708,7 +2708,7 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl
|
||||||
const QByteArray BASIC_AUTH_HEADER_KEY = "Authorization";
|
const QByteArray BASIC_AUTH_HEADER_KEY = "Authorization";
|
||||||
|
|
||||||
// check if a username and password have been provided with the request
|
// check if a username and password have been provided with the request
|
||||||
QString basicAuthString = connection->requestHeaders().value(BASIC_AUTH_HEADER_KEY);
|
QString basicAuthString = connection->requestHeader(BASIC_AUTH_HEADER_KEY);
|
||||||
|
|
||||||
if (!basicAuthString.isEmpty()) {
|
if (!basicAuthString.isEmpty()) {
|
||||||
QStringList splitAuthString = basicAuthString.split(' ');
|
QStringList splitAuthString = basicAuthString.split(' ');
|
||||||
|
|
|
@ -55,7 +55,7 @@ HTTPConnection::~HTTPConnection() {
|
||||||
|
|
||||||
QHash<QString, QString> HTTPConnection::parseUrlEncodedForm() {
|
QHash<QString, QString> HTTPConnection::parseUrlEncodedForm() {
|
||||||
// make sure we have the correct MIME type
|
// make sure we have the correct MIME type
|
||||||
QList<QByteArray> elements = _requestHeaders.value("Content-Type").split(';');
|
QList<QByteArray> elements = requestHeader("Content-Type").split(';');
|
||||||
|
|
||||||
QString contentType = elements.at(0).trimmed();
|
QString contentType = elements.at(0).trimmed();
|
||||||
if (contentType != "application/x-www-form-urlencoded") {
|
if (contentType != "application/x-www-form-urlencoded") {
|
||||||
|
@ -75,7 +75,7 @@ QHash<QString, QString> HTTPConnection::parseUrlEncodedForm() {
|
||||||
|
|
||||||
QList<FormData> HTTPConnection::parseFormData() const {
|
QList<FormData> HTTPConnection::parseFormData() const {
|
||||||
// make sure we have the correct MIME type
|
// make sure we have the correct MIME type
|
||||||
QList<QByteArray> elements = _requestHeaders.value("Content-Type").split(';');
|
QList<QByteArray> elements = requestHeader("Content-Type").split(';');
|
||||||
|
|
||||||
QString contentType = elements.at(0).trimmed();
|
QString contentType = elements.at(0).trimmed();
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ void HTTPConnection::readHeaders() {
|
||||||
if (trimmed.isEmpty()) {
|
if (trimmed.isEmpty()) {
|
||||||
_socket->disconnect(this, SLOT(readHeaders()));
|
_socket->disconnect(this, SLOT(readHeaders()));
|
||||||
|
|
||||||
QByteArray clength = _requestHeaders.value("Content-Length");
|
QByteArray clength = requestHeader("Content-Length");
|
||||||
if (clength.isEmpty()) {
|
if (clength.isEmpty()) {
|
||||||
_parentManager->handleHTTPRequest(this, _requestUrl);
|
_parentManager->handleHTTPRequest(this, _requestUrl);
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ void HTTPConnection::readHeaders() {
|
||||||
respond("400 Bad Request", "The header was malformed.");
|
respond("400 Bad Request", "The header was malformed.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_lastRequestHeader = trimmed.left(idx);
|
_lastRequestHeader = trimmed.left(idx).toLower();
|
||||||
QByteArray& value = _requestHeaders[_lastRequestHeader];
|
QByteArray& value = _requestHeaders[_lastRequestHeader];
|
||||||
if (!value.isEmpty()) {
|
if (!value.isEmpty()) {
|
||||||
value.append(", ");
|
value.append(", ");
|
||||||
|
|
|
@ -72,8 +72,8 @@ public:
|
||||||
/// Returns a reference to the request URL.
|
/// Returns a reference to the request URL.
|
||||||
const QUrl& requestUrl () const { return _requestUrl; }
|
const QUrl& requestUrl () const { return _requestUrl; }
|
||||||
|
|
||||||
/// Returns a reference to the request headers.
|
/// Returns a copy of the request header value. If it does not exist, it will return a default constructed QByteArray.
|
||||||
const Headers& requestHeaders () const { return _requestHeaders; }
|
QByteArray requestHeader(const QString& key) const { return _requestHeaders.value(key.toLower().toLocal8Bit()); }
|
||||||
|
|
||||||
/// Returns a reference to the request content.
|
/// Returns a reference to the request content.
|
||||||
const QByteArray& requestContent () const { return _requestContent; }
|
const QByteArray& requestContent () const { return _requestContent; }
|
||||||
|
|
|
@ -777,10 +777,13 @@ function findClickedEntity(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
var overlayResult = Overlays.findRayIntersection(pickRay, true, getMainTabletIDs());
|
var tabletIDs = getMainTabletIDs();
|
||||||
|
if (tabletIDs.length > 0) {
|
||||||
|
var overlayResult = Overlays.findRayIntersection(pickRay, true, tabletIDs);
|
||||||
if (overlayResult.intersects) {
|
if (overlayResult.intersects) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var entityResult = Entities.findRayIntersection(pickRay, true); // want precision picking
|
var entityResult = Entities.findRayIntersection(pickRay, true); // want precision picking
|
||||||
var iconResult = entityIconOverlayManager.findRayIntersection(pickRay);
|
var iconResult = entityIconOverlayManager.findRayIntersection(pickRay);
|
||||||
|
@ -968,8 +971,13 @@ function mouseReleaseEvent(event) {
|
||||||
|
|
||||||
function wasTabletClicked(event) {
|
function wasTabletClicked(event) {
|
||||||
var rayPick = Camera.computePickRay(event.x, event.y);
|
var rayPick = Camera.computePickRay(event.x, event.y);
|
||||||
|
var tabletIDs = getMainTabletIDs();
|
||||||
|
if (tabletIDs.length === 0) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs());
|
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs());
|
||||||
return result.intersects;
|
return result.intersects;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mouseClickEvent(event) {
|
function mouseClickEvent(event) {
|
||||||
|
|
Loading…
Reference in a new issue