@@ -52,21 +52,21 @@ function get(req, res, includeBody) {
5252 }
5353
5454 var filename = file . uriToFilename ( req . path , ldp . root ) ;
55- var baseUri = file . uriBase ( req ) ;
5655
5756 var aclLink = file . getResourceLink (
58- filename , baseUri ,
57+ filename , uri ,
5958 ldp . root , ldp . suffixAcl ,
6059 metaExtension ) ;
6160
6261 var metaLink = file . getResourceLink (
63- filename , baseUri ,
62+ filename , uri ,
6463 ldp . root , metaExtension ,
6564 ldp . suffixAcl ) ;
6665
6766 header . addLink ( res , aclLink , 'acl' ) ;
6867 header . addLink ( res , metaLink , 'describedBy' ) ;
6968
69+ // Get resource or container
7070 ldp . get ( filename , uri , includeBody , function ( err , data , container ) {
7171
7272 // This should be implemented in LDP.prototype.get
@@ -75,6 +75,7 @@ function get(req, res, includeBody) {
7575 return globHandler ( req , res ) ;
7676 }
7777
78+
7879 if ( err ) {
7980 debug ( 'GET/HEAD -- Read error: ' + err ) ;
8081 return res
@@ -112,9 +113,7 @@ function get(req, res, includeBody) {
112113 // TODO this should be added as a middleware in the routes
113114 res . locals . turtleData = data ;
114115 return parseLinkedData ( req , res ) ;
115-
116116 } ) ;
117-
118117}
119118
120119function globHandler ( req , res ) {
@@ -180,8 +179,6 @@ function aclAllow(match, req, res, callback) {
180179 }
181180
182181 var relativePath = '/' + path . relative ( ldp . root , match ) ;
183-
184- // TODO find a better hack, maybe pass as a param?
185182 res . locals . path = relativePath ;
186183 acl . allow ( "Read" , req , res , function ( err ) {
187184 callback ( ! err ) ;
@@ -218,6 +215,7 @@ function parseLinkedData(req, res) {
218215 . send ( err ) ;
219216 }
220217
218+ // Graph to `accept` type
221219 $rdf . serialize ( undefined , resourceGraph , null , accept , function ( err , result ) {
222220 if ( result === undefined || err ) {
223221 debug ( "GET/HEAD -- Serialization error: " + err ) ;
0 commit comments