1
0
Fork 0

Merge remote-tracking branch 'origin/1.4' into devel

Conflicts:
	CHANGELOG
	Documentation/man/man1/arangob.1
	Documentation/man/man1/arangodump.1
	Documentation/man/man1/arangoimp.1
	Documentation/man/man1/arangorestore.1
	Documentation/man/man1/arangosh.1
	Documentation/man/man8/arango-dfdb.8
	Documentation/man/man8/arangod.8
	Documentation/man/man8/foxx-manager.8
	Documentation/man/man8/rcarangod.8
	Makefile.in
	VERSION
	aclocal.m4
	build.h
	config/config.guess
	config/config.sub
	config/missing
	configure
	configure.ac
	js/apps/system/aardvark/api-docs.json
	js/apps/system/aardvark/api-docs/batch.json
	js/apps/system/aardvark/api-docs/collection.json
	js/apps/system/aardvark/api-docs/database.json
	js/apps/system/aardvark/api-docs/endpoint.json
	js/apps/system/aardvark/api-docs/job.json
	js/apps/system/aardvark/api-docs/replication.json
	js/apps/system/aardvark/api-docs/system.json
	js/server/bootstrap/module-internal.js
	js/server/modules/org/arangodb/actions.js
	js/server/modules/org/arangodb/foxx/authentication.js
	js/server/modules/org/arangodb/foxx/manager.js
	lib/ApplicationServer/ApplicationServer.cpp
This commit is contained in:
Frank Celler 2014-01-23 22:24:20 +01:00
commit 6679995e76
7 changed files with 55 additions and 37 deletions

View File

@ -115,7 +115,7 @@ v1.5.0 (XXXX-XX-XX)
currently only implemented for hash indices and skiplist indices.
v1.4.7 (XXXX-XX-XX)
v1.4.7 (2014-01-23)
-------------------
* issue #744: Add usage example arangoimp from Command line
@ -164,6 +164,7 @@ v1.4.5 (2014-01-15)
* added override file "arangod.conf.local" (and co)
v1.4.4 (2013-12-24)
-------------------

View File

@ -3,8 +3,8 @@ TOC {#InstallingTOC}
- @ref Installing
- @ref InstallingLinux
- @ref InstallingLinuxPackageManager
- @ref InstallingDebian
- @ref InstallingLinuxPackageManager
- @ref InstallingDebian
- @ref InstallingMacOSX
- @ref InstallingMacOSXHomebrew
- @ref InstallingMacOSXAppStore

View File

@ -41,7 +41,7 @@
"paramType": "query",
"required": "True",
"name": "type",
"description": "Determines how the body of the request will be interpreted. <em>type</em> can have the following values: "
"description": "Determines how the body of the request will be interpreted. <em>type</em> can have the following values: - <em>documents</em>: when this type is used, each line in the request body is expected to be an individual JSON-encoded document. Multiple JSON documents in the request body need to be separated by newlines. - <em>list</em>: when this type is used, the request body must contain a single JSON-encoded list of individual documents to import. - <em>auto</em>: if set, this will automatically determine the body type (either <em>documents</em> or <em>list</em>). "
},
{
"dataType": "String",
@ -115,7 +115,7 @@
"paramType": "body",
"required": "true",
"name": "documents",
"description": "The body must consist of JSON-encoded lists of attribute values, with one line per per document. The first line of the request must be a JSON-encoded list of attribute names. "
"description": "The body must consist of JSON-encoded lists of attribute values, with one line per per document. The first row of the request must be a JSON-encoded list of attribute names. These attribute names are used for the data in the subsequent rows. "
},
{
"dataType": "String",

View File

@ -1481,13 +1481,46 @@ function resultUnsupported (req, res, headers) {
/// @brief internal function for handling redirects
////////////////////////////////////////////////////////////////////////////////
function handleRedirect (req, res, destination, headers) {
function handleRedirect (req, res, options, headers) {
var destination;
var url;
destination = options.destination;
if (destination.substr(0,5) !== "http:" && destination.substr(0,6) !== "https:") {
url = req.protocol + "://";
if (req.headers.hasOwnProperty('host')) {
url += req.headers.host;
}
else {
url += req.server.address + ":" + req.server.port;
}
if (options.relative) {
var u = req.url;
if (0 < u.length && u[u.length - 1] === '/') {
url += "/_db/" + encodeURIComponent(req.database) + u + destination;
}
else {
url += "/_db/" + encodeURIComponent(req.database) + u + "/" + destination;
}
}
else {
url += destination;
}
}
else {
url = destination;
}
res.contentType = "text/html";
res.body = "<html><head><title>Moved</title>"
+ "</head><body><h1>Moved</h1><p>This page has moved to <a href=\""
+ destination
+ url
+ "\">"
+ destination
+ url
+ "</a>.</p></body></html>";
if (headers !== undefined) {
@ -1497,56 +1530,39 @@ function handleRedirect (req, res, destination, headers) {
res.headers = {};
}
res.headers.location = destination;
res.headers.location = url;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief generates a permanently redirect
///
/// @FUN{actions.resultPermanentRedirect(@FA{req}, @FA{res}, @FA{destination}, @FA{headers})}
/// @FUN{actions.resultPermanentRedirect(@FA{req}, @FA{res}, @FA{options}, @FA{headers})}
///
/// The function generates a redirect response.
////////////////////////////////////////////////////////////////////////////////
function resultPermanentRedirect (req, res, destination, headers) {
function resultPermanentRedirect (req, res, options, headers) {
'use strict';
res.responseCode = exports.HTTP_MOVED_PERMANENTLY;
if (destination.substr(0,5) !== "http:" && destination.substr(0,6) !== "https:") {
if (req.headers.hasOwnProperty('host')) {
destination = req.protocol
+ "://"
+ req.headers.host
+ destination;
}
else {
destination = req.protocol
+ "://"
+ req.server.address
+ ":"
+ req.server.port
+ destination;
}
}
handleRedirect(req, res, destination, headers);
handleRedirect(req, res, options, headers);
}
////////////////////////////////////////////////////////////////////////////////
/// @brief generates a temporary redirect
///
/// @FUN{actions.resultTemporaryRedirect(@FA{req}, @FA{res}, @FA{destination}, @FA{headers})}
/// @FUN{actions.resultTemporaryRedirect(@FA{req}, @FA{res}, @FA{options}, @FA{headers})}
///
/// The function generates a redirect response.
////////////////////////////////////////////////////////////////////////////////
function resultTemporaryRedirect (req, res, destination, headers) {
function resultTemporaryRedirect (req, res, options, headers) {
'use strict';
res.responseCode = exports.HTTP_TEMPORARY_REDIRECT;
handleRedirect(req, res, destination, headers);
handleRedirect(req, res, options, headers);
}
// -----------------------------------------------------------------------------
@ -1861,10 +1877,10 @@ function redirectRequest (req, res, options, next) {
'use strict';
if (options.permanently) {
resultPermanentRedirect(req, res, options.destination);
resultPermanentRedirect(req, res, options);
}
else {
resultTemporaryRedirect(req, res, options.destination);
resultTemporaryRedirect(req, res, options);
}
}

View File

@ -1016,7 +1016,7 @@ CookieAuthentication = function (applicationContext, options) {
this._options = {
name: options.name || this._applicationContext.name + "-session",
lifetime: options.lifetime || 3600,
path: options.path || this._applicationContext.mount,
path: options.path || "/",
domain: options.path || undefined,
secure: options.secure || false,
httpOnly: options.httpOnly || false

View File

@ -642,7 +642,8 @@ function routingAalApp (app, mount, options) {
"do" : "org/arangodb/actions/redirectRequest",
"options" : {
"permanently" : (app._id.substr(0,4) !== 'dev'),
"destination" : p + defaultDocument
"destination" : defaultDocument,
"relative" : true
}
}
});

2
js/server/version-check.js Normal file → Executable file
View File

@ -416,7 +416,7 @@
"do": "org/arangodb/actions/redirectRequest",
options: {
permanently: true,
destination: "/_db/" + db._name() + "/_admin/aardvark/index.html"
destination: "/_db/" + encodeURIComponent(db._name()) + "/_admin/aardvark/index.html"
}
},
priority: -1000000