Skip to content

Commit ab3e6ec

Browse files
author
nicola
committed
changing req.path -> req.originalUrl
1 parent 3f13d9d commit ab3e6ec

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎handlers/delete.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var metadata = require('../metadata.js');
88

99
// Delete a container or resource
1010
function handler(req, res) {
11-
debug('DELETE -- ' + req.path);
11+
debug('DELETE -- ' + req.originalUrl);
1212

1313
var options = req.app.locals.ldp;
1414
var filename = file.uriToFilename(req.path, options.root);

‎handlers/get.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function get(req, res, includeBody) {
2828
// Add request to subscription service
2929
if (req.path.slice(-options.suffixChanges.length) ===
3030
options.suffixChanges) {
31-
debug("GET -- Subscribed to ", req.path);
31+
debug("GET -- Subscribed to ", req.originalUrl);
3232
return subscription.subscribeToChanges(req, res);
3333
}
3434

@@ -39,16 +39,16 @@ function get(req, res, includeBody) {
3939
if (options.live) {
4040
// Note not yet in
4141
// http://www.iana.org/assignments/link-relations/link-relations.xhtml
42-
header.addLink(res, req.path + options.suffixChanges, 'changes');
42+
header.addLink(res, req.originalUrl + options.suffixChanges, 'changes');
4343
// res.header('Link' , '' + req.path + options.suffixSSE + ' ; rel=events' );
4444
// overwrites the pevious
45-
res.header('Updates-Via', req.path + options.suffixChanges);
45+
res.header('Updates-Via', req.originalUrl + options.suffixChanges);
4646
}
4747

4848
if (includeBody) {
49-
debug('GET -- ' + req.path);
49+
debug('GET -- ' + req.originalUrl);
5050
} else {
51-
debug('HEAD -- ' + req.path);
51+
debug('HEAD -- ' + req.originalUrl);
5252
}
5353

5454
var filename = file.uriToFilename(req.path, options.root);

‎handlers/patch.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ var options = require('../options.js');
1212

1313
function handler(req, res) {
1414
var options = req.app.locals.ldp;
15-
debug('PATCH -- ' +req.path);
15+
debug('PATCH -- ' + req.originalUrl);
1616
debug('PATCH -- text length: ' + (req.text ? req.text.length : 'undefined2'));
1717
res.header('MS-Author-Via' , 'SPARQL' );
1818
var filename = file.uriToFilename(req.path, options.root);
1919
var patchContentType = req.get('content-type').split(';')[0].trim(); // Ignore parameters
2020
var targetContentType = mime.lookup(filename);
2121
var targetURI = file.uriAbs(req) + req.originalUrl;
22+
console.log(file.uriBase(req));
2223
var patchURI = targetURI ; // @@@ beware the triples from the patch ending up in the same place
2324
debug("PATCH -- Content-type " + patchContentType + " patching target " + targetContentType + " <" + targetURI + '>');
2425
var targetKB = $rdf.graph();

‎handlers/put.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var options = require('../options.js');
1414

1515
function handler(req, res) {
1616
var options = req.app.locals.ldp;
17-
debug("PUT -- Request path: " + req.path);
17+
debug("PUT -- Request path: " + req.originalUrl);
1818
debug("PUT -- Text length: " + (req.text ? req.text.length : 'undefined'));
1919
res.header('MS-Author-Via' , 'SPARQL' );
2020

0 commit comments

Comments
 (0)