Closed stat1x closed 1 year ago
Hey @stat1x Could you check if a "xxx.config.json" file is part of the cache files (should be directly next to the html/gz cache entriy file in typo3temp/tx_staticfilecache). If the config.json exists, could you check if the header is part of the config file? Do you try to set this header via a middleware instead via TS? Regards, Tim
Yes the xxx.config.json is correct and has my custom headers. No didn't try with a middleware as it will probably work fine with it. IMO, config.additionalHeaders should be taken into account when using staticfilecache without adding an extra middleware.
I think you talk about other middlewares? StaticFileCache uses (and need) multiple middlewares. Yes "config.additionalHeaders" is used by TYPO3 without StaticFileCache, but only in the generation process (first hit). After the first hit and a valid/good strategy, the content is not renderd by TYPO3 anymore. We have to check, which component do not set the header. Could you enable "debugHeaders" in the extension configuration and check "X-SFC-State"-Header and send me the value. Then we can check, if the FallbackMiddlware is the problem or the cache entry itself.
Regards, Tim
Yes I do not want to add an own Middleware as there is an option in TypoScript to add additionnal headers. If I turn debugHeaders to true, I have the SFC debug header as excepted. Unfortunately, I do not have the additional headers defined in TypoScript. If I turn off SFC I get them. The xxx.config.json is correct and contains the additional headers. I've added the "Step to reproduce" in the description. Best regards, Jay
hey @stat1x If you saw the Debug header of StaticFileCache, I need the value of the Header, because only then I know which component (TYPO3 rendering, StaticfileCache deilivery, Fallback Middleware etc.) result in your the missing header! Regards, Tim
Hey @stat1x checked the PR... so the FallbackMiddlware cause this problem. We should only add a whitelist, so TYPo3 do not add every header of the config.json. Regards, Tim
Bug Report
Current Behavior When adding custom headers in config.additionalHeaders and in validHtaccessHeaders, those headers are not in response when useFallbackMiddleware is set to true.
Expected behavior/output The custom headers should be in response.
Environment
Possible Solution In the FallbackMiddleware, the getHeaders method seems to be the problem. In fact, the custom headers that are correctly set in the .config.json file are never read. I can manager a PR for that.
Step to reproduce