On GitLab.com, my team has noticed that HTML files uploaded as artifacts in CI jobs are being served with a text/plain Content-Type header. They previously were served with text/html and displayed correctly in the browser, which was very useful for reviewing automatically-deployed work in MRs. This behavior changed sometime within the last couple days, as far as we can tell.
We also are on gitlab.com, with the Premium SaaS Plan. (retail-reload group). We have exactly the same issue, which is pretty disrupting as we use this feature in our Doc as code CI/CD pipeline, to review doc changes before deploying them in production.
We did not change anything in the CI/CD configuration. We noticed the error this afternoon (CST time), it was working properly 3 or 4 days ago: The files with the .html extensions were properly served with the text/html Content type on the project gitlab page, after the user clicked the link in the artifact browser: https://gitlab.com/{group}/{subgroup}/{project}/-/jobs/{jobid}/artifacts/browse/{artifact_dir}/
The user would click on the link https://gitlab.com/{group}/{subgroup}/{project}/-/jobs/{jobid}/artifacts/file/{artifact_dir}/index.html
then get redirected to : https://{group}.gitlab.io/-/{subgroup}/{project}/-/jobs/{job_id}/artifacts/{artifact_dir}/index.html
Expected result: The HTML file is rendered as an HTML file by the browser
Actual result: The HTML content is rendered as a text file. The browser (we tried Safari and Chrome) does not seem to be at fault here, see OP: the gitlab pages sends the wrong content type for the file content
Could somebody from the Gitlab.com team have a look at this please ?
That content-negotiation issue could possibly help if it was implemented, but it doesn’t look like it directly relates to the recent change in behavior.