Commit eef66309 authored by jan.koester's avatar jan.koester
Browse files

test

parent ed9e9569
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -5401,7 +5401,21 @@ void webedit::Api::handleImportHtml(libhttppp::HttpRequest &curreq,
        }

        if (!mediaAuthid.empty() && !mediaBlogUrl.empty()) {
            const size_t kMaxImages = 30;
            // Every URL beyond this cap is silently counted as "failed"
            // below (see externalUrls.size() - importCount) without even
            // being attempted -- found via a real import that reported "55
            // Bild(er) fehlgeschlagen" for a page whose actual external
            // image/CustomCss-url() count comfortably exceeded the previous
            // cap of 30, a real-world-typical count for an image-heavy
            // marketing/portfolio site (galleries, badges, background
            // decorations, avatars). Raised with real numbers, not a guess:
            // a single fetchExternalResource() round trip against a real
            // CDN (CloudFront-backed) measured ~0.1s, so even a full 150-
            // image import stays well under a second's worth of network
            // time per image and nowhere near typical reverse-proxy/browser
            // request-timeout territory -- the previous cap of 30 was far
            // more conservative than the actual cost justified.
            const size_t kMaxImages = 150;
            const size_t kMaxImageBytes = 15 * 1024 * 1024;
            std::unordered_map<std::string, UploadedExternalImage> uploaded;