1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-28 03:41:58 +00:00

Update key allowed characters

This commit is contained in:
Alan Grainger 2024-10-28 10:09:59 +01:00
parent 1d343fe9d2
commit 8e30b559a1
2 changed files with 3 additions and 3 deletions

4
dist/index.js vendored
View file

@ -8,7 +8,7 @@ const app = (0, express_1.default)();
require('dotenv').config();
app.get('/share/:key', (req, res) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
var _a;
if (req.params.key.match(/[^A-Za-z0-9-]/)) {
if (req.params.key.match(/[^\w-]/)) {
// Invalid characters in the incoming URL
res.status(404).send();
}
@ -34,4 +34,4 @@ app.get('/share/:key', (req, res) => tslib_1.__awaiter(void 0, void 0, void 0, f
app.listen(3000, () => {
console.log((0, dayjs_1.default)().format() + ' Server started');
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsOERBQTZCO0FBQzdCLDhEQUEwQjtBQUMxQiwwREFBeUI7QUFFekIsTUFBTSxHQUFHLEdBQUcsSUFBQSxpQkFBTyxHQUFFLENBQUE7QUFFckIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLE1BQU0sRUFBRSxDQUFBO0FBRTFCLEdBQUcsQ0FBQyxHQUFHLENBQUMsYUFBYSxFQUFFLENBQU8sR0FBRyxFQUFFLEdBQUcsRUFBRSxFQUFFOztJQUN4QyxJQUFJLEdBQUcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxlQUFlLENBQUMsRUFBRSxDQUFDO1FBQzFDLHlDQUF5QztRQUN6QyxHQUFHLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksRUFBRSxDQUFBO0lBQ3hCLENBQUM7U0FBT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W5kKClcbiAgfSBlbHNlIHtcbiAgICBjb25zdCBzaGFyZSA9IGF3YWl0IGFwaS5nZXRTaGFyZUJ5S2V5KHJlcS5wYXJhbXMua2V5KVxuICAgIGlmIChzaGFyZT8uYXNzZXRzPy5sZW5ndGggPT09IDEpIHtcbiAgICAgIC8vIFRoaXMgaXMgYW4gaW5kaXZpZHVhbCBpdGVtIChub3QgYSBnYWxsZXJ5KVxuICAgICAgLy8gUmV0dXJuIHRoZSBmdWxsLXNpemUgaW1hZ2UuXG4gICAgICBjb25zdCBzaXplID0gcmVxLnF1ZXJ5LnNpemUgPT09ICd0aHVtYm5haWwnID8gJ3RodW1ibmFpbCcgOiAnb3JpZ2luYWwnXG4gICAgICBjb25zdCBpbWFnZSA9IGF3YWl0IGFwaS5nZXRJbWFnZShzaGFyZS5hc3NldHNbMF0uaWQsIHNpemUpXG4gICAgICBmb3IgKGNvbnN0IGhlYWRlciBvZiBbJ2NvbnRlbnQtdHlwZScsICdjb250ZW50LWxlbmd0aCddKSB7XG4gICAgICAgIHJlcy5zZXQoaGVhZGVyLCBpbWFnZS5oZWFkZXJzW2hlYWRlcl0pXG4gICAgICB9XG4gICAgICBjb25zdCBkYXRhID0gYXdhaXQgaW1hZ2UuYXJyYXlCdWZmZXIoKVxuICAgICAgY29uc29sZS5sb2coZGF5anMoKS5mb3JtYXQoKSArICcgU2VydmluZyBpbWFnZSAnICsgc2hhcmUuYXNzZXRzWzBdLmlkKVxuICAgICAgcmVzLnNlbmQoQnVmZmVyLmZyb20oZGF0YSkpXG4gICAgfSBlbHNlIHtcbiAgICAgIHJlcy5zZW5kKClcbiAgICB9XG4gIH1cbn0pXG5cbmFwcC5saXN0ZW4oMzAwMCwgKCkgPT4ge1xuICBjb25zb2xlLmxvZyhkYXlqcygpLmZvcm1hdCgpICsgJyBTZXJ2ZXIgc3RhcnRlZCcpXG59KVxuIl19

View file

@ -7,7 +7,7 @@ const app = express()
require('dotenv').config()
app.get('/share/:key', async (req, res) => {
if (req.params.key.match(/[^A-Za-z0-9-_]/)) {
if (req.params.key.match(/[^\w-]/)) {
// Invalid characters in the incoming URL
res.status(404).send()
} else {