Co-authored-by: Zeoic <zeorgaming@gmail.com>
Co-authored-by: Fesaa <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo 2025-03-01 17:17:57 -06:00 committed by GitHub
parent b38400c092
commit 0ffe0228e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 339 additions and 115 deletions

View file

@ -311,8 +311,16 @@ public class BookService : IBookService
var imageFile = GetKeyForImage(book, image.Attributes[key].Value);
image.Attributes.Remove(key);
// UrlEncode here to transform ../ into an escaped version, which avoids blocking on nginx
image.Attributes.Add(key, $"{apiBase}" + Uri.EscapeDataString(imageFile));
if (!imageFile.StartsWith("http"))
{
// UrlEncode here to transform ../ into an escaped version, which avoids blocking on nginx
image.Attributes.Add(key, $"{apiBase}" + Uri.EscapeDataString(imageFile));
}
else
{
image.Attributes.Add(key, imageFile);
}
// Add a custom class that the reader uses to ensure images stay within reader
parent.AddClass("kavita-scale-width-container");