fix ALP generation and default to it

This commit is contained in:
zefie
2026-04-26 22:01:14 -04:00
parent 6342f51d22
commit 2232beacb7
2 changed files with 33 additions and 5 deletions

View File

@@ -1314,9 +1314,15 @@ async function sendToClient(socket, headers_obj, data = null) {
}
let imageArtemisType = 'ALP'
// Add last modified if not a dynamic script
if (socket_sessions[socket.id]) {
if (socket_sessions[socket.id].request_headers) {
if (socket_sessions[socket.id].request_headers.query) {
if (socket_sessions[socket.id].request_headers.query.forceALF) {
imageArtemisType = 'ALF';
}
}
if (socket_sessions[socket.id].request_headers.service_file_path) {
// Don't change Last-modified header if provided already
if (!headers['Last-Modified'] && !headers['minisrv-no-last-modified']) {
@@ -1354,7 +1360,7 @@ async function sendToClient(socket, headers_obj, data = null) {
if (minisrv_config.config.image_decoder.image_formats && minisrv_config.config.image_decoder.image_formats.includes(headers_obj[contype_key].toLowerCase())) {
const convertOpts = {
jpegQuality: minisrv_config.config.image_decoder.jpg_quality,
type: 'ALF'
type: imageArtemisType
};
if (minisrv_config.config.image_decoder.max_height > 0) convertOpts.maxHeight = minisrv_config.config.image_decoder.max_height;