Introduction of the images to the detailed view to the library_table.html
Release Inventarsystem / release-docker (push) Successful in 2m15s
Release Inventarsystem / release-docker (push) Successful in 2m15s
This commit is contained in:
+27
-7
@@ -466,16 +466,36 @@ PERMISSION_ACTION_ENDPOINTS = {
|
||||
}
|
||||
|
||||
ALLOWED_COVER_DOMAINS = {
|
||||
# --- Google / Open APIs ---
|
||||
"books.google.com",
|
||||
"covers.openlibrary.org",
|
||||
"images-na.ssl-images-amazon.com",
|
||||
"m.media-amazon.com",
|
||||
"www.isbn.de",
|
||||
"www.googleapis.com",
|
||||
|
||||
# --- Open Library / Internet Archive ---
|
||||
"covers.openlibrary.org",
|
||||
"openlibrary.org",
|
||||
|
||||
# --- Amazon / Goodreads ---
|
||||
"images-na.ssl-images-amazon.com",
|
||||
"m.media-amazon.com",
|
||||
"i.gr-assets.com", # Goodreads image CDN
|
||||
|
||||
# --- Library / Catalog Services ---
|
||||
"www.isbn.de",
|
||||
"lobid.org",
|
||||
"www.googleapis.com",
|
||||
"www.westermann.de"
|
||||
"syndetics.com", # Standard cover provider for libraries
|
||||
"pics.librarything.com", # LibraryThing covers
|
||||
"portal.dnb.de", # Deutsche Nationalbibliothek
|
||||
|
||||
# --- German Educational & International Publishers ---
|
||||
"www.westermann.de",
|
||||
"www.klett.de", # Ernst Klett Verlag
|
||||
"medien.klett.de", # Klett media CDN
|
||||
"www.cornelsen.de", # Cornelsen Verlag
|
||||
"images.penguinrandomhouse.com", # Penguin Random House
|
||||
|
||||
# --- Book Retailer CDNs (often used for cover fetching) ---
|
||||
"images.thalia.media", # Thalia
|
||||
"bilder.buecher.de" # buecher.de
|
||||
}
|
||||
|
||||
SENSITIVE_AUDIT_FIELDS = ["email", "username", "full_name", "phone", "borrower", "ip"]
|
||||
@@ -10044,7 +10064,7 @@ def download_book_cover():
|
||||
return jsonify({"error": "Only public HTTPS URLs are allowed"}), 400
|
||||
|
||||
# 2. SSRF Protection: Strict Allowlist Check
|
||||
# if parsed_url.netloc not in ALLOWED_COVER_DOMAINS: # ---------------------------------------------- has to be implementet at a laterstage ---------------------------------------------------------------
|
||||
# if parsed_url.netloc not in ALLOWED_COVER_DOMAINS:
|
||||
# return jsonify({"error": "Target host is not an allowed book cover provider"}), 403
|
||||
|
||||
# Download the image (allow_redirects=False prevents redirecting to internal IPs)
|
||||
|
||||
Reference in New Issue
Block a user