mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 19:23:04 +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 = {};
|
||||
}
|
||||
|
||||
Object.assign(Settings, {
|
||||
$.extend(Settings, {
|
||||
DEPRECATED_CLASS: 'deprecated-setting',
|
||||
TRIGGER_CHANGE_CLASS: 'trigger-change',
|
||||
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_POOL_HEADER = "ASSIGNMENT-POOL";
|
||||
|
||||
QByteArray assignmentInstancesValue = connection->requestHeaders().value(ASSIGNMENT_INSTANCES_HEADER.toLocal8Bit());
|
||||
QByteArray assignmentInstancesValue = connection->requestHeader(ASSIGNMENT_INSTANCES_HEADER.toLocal8Bit());
|
||||
|
||||
int numInstances = 1;
|
||||
|
||||
|
@ -2234,7 +2234,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
}
|
||||
|
||||
QString assignmentPool = emptyPool;
|
||||
QByteArray assignmentPoolValue = connection->requestHeaders().value(ASSIGNMENT_POOL_HEADER.toLocal8Bit());
|
||||
QByteArray assignmentPoolValue = connection->requestHeader(ASSIGNMENT_POOL_HEADER.toLocal8Bit());
|
||||
|
||||
if (!assignmentPoolValue.isEmpty()) {
|
||||
// specific pool requested, set that on the created assignment
|
||||
|
@ -2632,7 +2632,7 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl
|
|||
|
||||
if (!_oauthProviderURL.isEmpty()
|
||||
&& (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-]+)($|;)";
|
||||
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 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
|
||||
// path to OAuth authorize
|
||||
connection->respond(HTTPConnection::StatusCode401, UNAUTHENTICATED_BODY);
|
||||
|
@ -2708,7 +2708,7 @@ bool DomainServer::isAuthenticatedRequest(HTTPConnection* connection, const QUrl
|
|||
const QByteArray BASIC_AUTH_HEADER_KEY = "Authorization";
|
||||
|
||||
// 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()) {
|
||||
QStringList splitAuthString = basicAuthString.split(' ');
|
||||
|
|
|
@ -55,7 +55,7 @@ HTTPConnection::~HTTPConnection() {
|
|||
|
||||
QHash<QString, QString> HTTPConnection::parseUrlEncodedForm() {
|
||||
// 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();
|
||||
if (contentType != "application/x-www-form-urlencoded") {
|
||||
|
@ -75,7 +75,7 @@ QHash<QString, QString> HTTPConnection::parseUrlEncodedForm() {
|
|||
|
||||
QList<FormData> HTTPConnection::parseFormData() const {
|
||||
// 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();
|
||||
|
||||
|
@ -251,7 +251,7 @@ void HTTPConnection::readHeaders() {
|
|||
if (trimmed.isEmpty()) {
|
||||
_socket->disconnect(this, SLOT(readHeaders()));
|
||||
|
||||
QByteArray clength = _requestHeaders.value("Content-Length");
|
||||
QByteArray clength = requestHeader("Content-Length");
|
||||
if (clength.isEmpty()) {
|
||||
_parentManager->handleHTTPRequest(this, _requestUrl);
|
||||
|
||||
|
@ -275,7 +275,7 @@ void HTTPConnection::readHeaders() {
|
|||
respond("400 Bad Request", "The header was malformed.");
|
||||
return;
|
||||
}
|
||||
_lastRequestHeader = trimmed.left(idx);
|
||||
_lastRequestHeader = trimmed.left(idx).toLower();
|
||||
QByteArray& value = _requestHeaders[_lastRequestHeader];
|
||||
if (!value.isEmpty()) {
|
||||
value.append(", ");
|
||||
|
|
|
@ -72,8 +72,8 @@ public:
|
|||
/// Returns a reference to the request URL.
|
||||
const QUrl& requestUrl () const { return _requestUrl; }
|
||||
|
||||
/// Returns a reference to the request headers.
|
||||
const Headers& requestHeaders () const { return _requestHeaders; }
|
||||
/// Returns a copy of the request header value. If it does not exist, it will return a default constructed QByteArray.
|
||||
QByteArray requestHeader(const QString& key) const { return _requestHeaders.value(key.toLower().toLocal8Bit()); }
|
||||
|
||||
/// Returns a reference to the request content.
|
||||
const QByteArray& requestContent () const { return _requestContent; }
|
||||
|
|
|
@ -777,9 +777,12 @@ function findClickedEntity(event) {
|
|||
}
|
||||
|
||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||
var overlayResult = Overlays.findRayIntersection(pickRay, true, getMainTabletIDs());
|
||||
if (overlayResult.intersects) {
|
||||
return null;
|
||||
var tabletIDs = getMainTabletIDs();
|
||||
if (tabletIDs.length > 0) {
|
||||
var overlayResult = Overlays.findRayIntersection(pickRay, true, tabletIDs);
|
||||
if (overlayResult.intersects) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var entityResult = Entities.findRayIntersection(pickRay, true); // want precision picking
|
||||
|
@ -968,8 +971,13 @@ function mouseReleaseEvent(event) {
|
|||
|
||||
function wasTabletClicked(event) {
|
||||
var rayPick = Camera.computePickRay(event.x, event.y);
|
||||
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs());
|
||||
return result.intersects;
|
||||
var tabletIDs = getMainTabletIDs();
|
||||
if (tabletIDs.length === 0) {
|
||||
return false;
|
||||
} else {
|
||||
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs());
|
||||
return result.intersects;
|
||||
}
|
||||
}
|
||||
|
||||
function mouseClickEvent(event) {
|
||||
|
|
Loading…
Reference in a new issue