forked from cory/tildefriends
At least some feedback if we can't save an app.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4065 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
cd8b32b3ca
commit
376094452e
11
core/core.js
11
core/core.js
@ -630,10 +630,9 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (uri == "/save") {
|
} else if (uri == "/save") {
|
||||||
let newBlobId = await ssb.blobStore(request.body);
|
|
||||||
|
|
||||||
var match;
|
var match;
|
||||||
if (match = /^\/\~(\w+)\/(\w+)$/.exec(blobId)) {
|
if (match = /^\/\~(\w+)\/(\w+)$/.exec(blobId)) {
|
||||||
|
let newBlobId = await ssb.blobStore(request.body);
|
||||||
var user = match[1];
|
var user = match[1];
|
||||||
var appName = match[2];
|
var appName = match[2];
|
||||||
var credentials = auth.query(request.headers);
|
var credentials = auth.query(request.headers);
|
||||||
@ -660,10 +659,14 @@ async function blobHandler(request, response, blobId, uri) {
|
|||||||
response.end("401 Unauthorized");
|
response.end("401 Unauthorized");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
|
||||||
|
response.end("/" + newBlobId);
|
||||||
|
} else {
|
||||||
|
response.writeHead(400, {"Content-Type": "text/plain; charset=utf-8"});
|
||||||
|
response.end('Invalid name.');
|
||||||
}
|
}
|
||||||
|
|
||||||
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
|
|
||||||
response.end("/" + newBlobId);
|
|
||||||
} else if (uri == "/delete") {
|
} else if (uri == "/delete") {
|
||||||
let match;
|
let match;
|
||||||
if (match = /^\/\~(\w+)\/(\w+)$/.exec(blobId)) {
|
if (match = /^\/\~(\w+)\/(\w+)$/.exec(blobId)) {
|
||||||
|
@ -94,6 +94,7 @@ function Response(request, client) {
|
|||||||
200: 'OK',
|
200: 'OK',
|
||||||
303: 'See other',
|
303: 'See other',
|
||||||
304: 'Not Modified',
|
304: 'Not Modified',
|
||||||
|
400: 'Bad Request',
|
||||||
403: 'Forbidden',
|
403: 'Forbidden',
|
||||||
404: 'File not found',
|
404: 'File not found',
|
||||||
500: 'Internal server error',
|
500: 'Internal server error',
|
||||||
|
Loading…
Reference in New Issue
Block a user