1.7.1
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
<p align="center" width="100%">
|
<p align="center" width="100%">
|
||||||
<a href="https://hub.docker.com/r/alangrainger/immich-public-proxy/tags">
|
<a href="https://hub.docker.com/r/alangrainger/immich-public-proxy/tags">
|
||||||
<img alt="Docker pulls" src="https://badgen.net/docker/pulls/alangrainger/immich-public-proxy?v1.7.0&icon=docker&label=docker%20pulls&color=green&scale=1.1"></a>
|
<img alt="Docker pulls" src="https://badgen.net/docker/pulls/alangrainger/immich-public-proxy?v1.7.1&icon=docker&label=docker%20pulls&color=green&scale=1.1"></a>
|
||||||
<a href="https://github.com/alangrainger/immich-public-proxy/releases/latest">
|
<a href="https://github.com/alangrainger/immich-public-proxy/releases/latest">
|
||||||
<img alt="Latest release" src="https://badgen.net/static/release/v1.7.0/blue?scale=1.1"></a>
|
<img alt="Latest release" src="https://badgen.net/static/release/v1.7.1/blue?scale=1.1"></a>
|
||||||
<a href="https://immich-demo.note.sx/share/gJfs8l4LcJJrBUpjhMnDoKXFt1Tm5vKXPbXl8BgwPtLtEBCOOObqbQdV5i0oun5hZjQ"><img alt="Open demo gallery" src="https://badgen.net/static/↗🖼️/live%20demo/green?scale=1.1"></a>
|
<a href="https://immich-demo.note.sx/share/gJfs8l4LcJJrBUpjhMnDoKXFt1Tm5vKXPbXl8BgwPtLtEBCOOObqbQdV5i0oun5hZjQ"><img alt="Open demo gallery" src="https://badgen.net/static/↗🖼️/live%20demo/green?scale=1.1"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "immich-public-proxy",
|
"name": "immich-public-proxy",
|
||||||
"version": "1.7.0",
|
"version": "1.7.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"build": "npx tsc",
|
"build": "npx tsc",
|
||||||
|
|||||||
+4
-3
@@ -43,9 +43,6 @@ class Immich {
|
|||||||
* 404 - any other failed request. Check console.log for details.
|
* 404 - any other failed request. Check console.log for details.
|
||||||
*/
|
*/
|
||||||
async handleShareRequest (request: IncomingShareRequest, res: Response) {
|
async handleShareRequest (request: IncomingShareRequest, res: Response) {
|
||||||
// Add the headers configured in config.json (most likely `cache-control`)
|
|
||||||
addResponseHeaders(res)
|
|
||||||
|
|
||||||
// Check that the key is a valid format
|
// Check that the key is a valid format
|
||||||
if (!immich.isKey(request.key)) {
|
if (!immich.isKey(request.key)) {
|
||||||
log('Invalid share key ' + request.key)
|
log('Invalid share key ' + request.key)
|
||||||
@@ -73,6 +70,9 @@ class Immich {
|
|||||||
if (sharedLinkRes.passwordRequired) {
|
if (sharedLinkRes.passwordRequired) {
|
||||||
// `request.key` is already sanitised at this point, but it never hurts to be explicit
|
// `request.key` is already sanitised at this point, but it never hurts to be explicit
|
||||||
const key = request.key.replace(/[^\w-]/g, '')
|
const key = request.key.replace(/[^\w-]/g, '')
|
||||||
|
res.header('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate')
|
||||||
|
res.header('Pragma', 'no-cache')
|
||||||
|
res.header('Expires', '0')
|
||||||
res.render('password', {
|
res.render('password', {
|
||||||
key,
|
key,
|
||||||
lgConfig: render.lgConfig,
|
lgConfig: render.lgConfig,
|
||||||
@@ -96,6 +96,7 @@ class Immich {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Everything is ok - output the shared link data
|
// Everything is ok - output the shared link data
|
||||||
|
addResponseHeaders(res)
|
||||||
|
|
||||||
if (request.mode === 'download' && getConfigOption('ipp.allowDownloadAll', false)) {
|
if (request.mode === 'download' && getConfigOption('ipp.allowDownloadAll', false)) {
|
||||||
// Download all assets as a zip file
|
// Download all assets as a zip file
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ app.use(express.json())
|
|||||||
app.use('/share/static', express.static('public', { setHeaders: addResponseHeaders }))
|
app.use('/share/static', express.static('public', { setHeaders: addResponseHeaders }))
|
||||||
// Serve the same assets on /, to allow for /robots.txt and /favicon.ico
|
// Serve the same assets on /, to allow for /robots.txt and /favicon.ico
|
||||||
app.use(express.static('public', { setHeaders: addResponseHeaders }))
|
app.use(express.static('public', { setHeaders: addResponseHeaders }))
|
||||||
|
// Remove the X-Powered-By ExpressJS header
|
||||||
|
app.disable('x-powered-by')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Middleware to decode the encrypted data stored in the session cookie
|
* Middleware to decode the encrypted data stored in the session cookie
|
||||||
|
|||||||
Reference in New Issue
Block a user