Skip to content

Commit e3593da

Browse files
author
Martin Martinez Rivera
committed
Support for nquads and json-ld files and other minor fixes.
1 parent e2f0dda commit e3593da

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

‎handlers/post.js‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,17 @@ function handler(req, res) {
3434
// Error on invalid content-type
3535
if (contentType != 'text/turtle' &&
3636
contentType != 'text/n3' &&
37-
contentType != 'application/rdf+xml') {
38-
//TODO Handle json and nquad content types
37+
contentType != 'application/rdf+xml' &&
38+
contentType != 'application/json+ld' &&
39+
contentType != 'application/nquads' &&
40+
contentType != 'application/n-quads') {
3941
debug("POST -- Invalid Content Type: " + contentType);
4042
return res.status(415).send("Invalid Content Type");
4143
}
4244

4345

4446
var containerPath = file.uriToFilename(req.path, options.root);
4547
debug("POST -- Container path: " + containerPath);
46-
47-
// Container not found/invalid
48-
if (metadata.isMetadataFile(containerPath)) {
49-
debug("POST -- Invalid container.");
50-
return res.sendStatus(404);
51-
}
5248

5349
// Not a container
5450
if (containerPath[containerPath.length - 1] != '/') {
@@ -75,7 +71,6 @@ function handler(req, res) {
7571
}
7672

7773
var resourceGraph = $rdf.graph();
78-
// TODO make sure correct text is selected
7974
var requestText = req.convertedText || req.text;
8075
var uri = file.uriBase(req);
8176
var resourceBaseUri = file.filenameToBaseUri(
@@ -136,5 +131,4 @@ function handler(req, res) {
136131
}
137132
}
138133

139-
140134
exports.handler = handler;

0 commit comments

Comments
 (0)