Skip to content

Commit 3b95bda

Browse files
author
nicola
committed
containers are ok with no uriBase
1 parent b979ebf commit 3b95bda

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎handlers/post.js‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,15 @@ function handler(req, res) {
6868
resourceMetadata.isBasicContainer);
6969

7070
if (resourcePath === null) {
71-
container.releaseResourceUri(options, resourcePath);
71+
container.releaseResourceUri(options.usedURIs, resourcePath);
7272
debug("POST -- URI already exists or in use");
7373
return res.sendStatus(400);
7474
}
75-
var resourceGraph = $rdf.graph();
7675

76+
var resourceGraph = $rdf.graph();
7777
// Get the request text
7878
// TODO make sure correct text is selected
7979
var requestText = req.convertedText || req.text;
80-
8180
var uri = options.uri || file.uriAbs(req);
8281
var resourceBaseUri = file.filenameToBaseUri(
8382
resourcePath,
@@ -93,7 +92,7 @@ function handler(req, res) {
9392
contentType);
9493
} catch (parseErr) {
9594
debug("POST -- Error parsing resource: " + parseErr);
96-
container.releaseResourceUri(options, resourcePath);
95+
container.releaseResourceUri(options.usedURIs, resourcePath);
9796
return res.sendStatus(400);
9897
}
9998

@@ -103,13 +102,16 @@ function handler(req, res) {
103102
resourcePath += '/';
104103
resourceBaseUri += '/';
105104
container.createNewContainer(
106-
options,
105+
options.usedURIs,
106+
uri,
107107
resourcePath,
108108
resourceGraph,
109109
containerCallback);
110110
} else {
111111
container.createNewResource(
112-
options,
112+
options.usedURIs,
113+
options.base,
114+
uri,
113115
resourcePath,
114116
resourceGraph,
115117
resourceCallback);

‎index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function ldnode (argv) {
5252
container.createRootContainer(opts.fileBase, opts.pathStart);
5353

5454
// Setting up routes
55-
app.use('/', routes());
55+
app.use(opts.pathStart, routes());
5656

5757
// Adding proxy
5858
if (opts.xssProxy) {

0 commit comments

Comments
 (0)