[go: up one dir, main page]

Skip to content

SVG rendering inside an asciidoc file breaks randomly

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Hello,

I'm using Gitlab CE docker image gitlab/gitlab-ce:15.10.2-ce.0.

When I have an asciidoc file index.adoc with some links to svg files, such as

.index.adoc

= ins-server: Service Inscription

.File 1
image::software.svg[]

.File 2
image::network.svg[]

.File 3
image::swimlane.svg[]

When I use the browser to see the page: http://localhost:8080/gitlab-instance-db28d2b2/ins-server/-/tree/test-svg/docs/src/modules/ROOT/pages

Sometime one image displays correctly, and sometimes it doesn't (in this case, I see only a link).

The issue seems related to the Content-Type HTTP response header.

When I open chrome dev tools, and look the network tab for http://localhost:8080/gitlab-instance-db28d2b2/ins-server/-/raw/test-svg/docs/src/modules/ROOT/pages/software.svg:

  • when it works, I see the HTTP response:
Cache-Control: max-age=60, private, must-revalidate, stale-while-revalidate=60, stale-if-error=300, s-maxage=60
Connection: keep-alive
Content-Disposition: attachment
Content-Length: 63681
Content-Security-Policy
Content-Type: image/svg+xml
Date: Mon, 10 Apr 2023 20:31:34 GMT
Etag: "b3baf8a8132205b89986da9a92940645"
Permissions-Policy: interest-cohort=()
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Request-Id: 01GXPDVSD8S6P7FCD8CAMZYHP1
X-Runtime: 0.083277
X-Ua-Compatible: IE=edge
X-Xss-Protection: 1; mode=block
  • when it doesn't work, I see the HTTP response headers (look at Content-Type):
Cache-Control: max-age=60, private, must-revalidate, stale-while-revalidate=60, stale-if-error=300, s-maxage=60
Connection: keep-alive
Content-Disposition: inline
Content-Encoding: gzip
Content-Security-Policy
Content-Type: text/plain; charset=utf-8
Date: Mon, 10 Apr 2023 20:29:28 GMT
Etag: W/"b3baf8a8132205b89986da9a92940645"
Permissions-Policy: interest-cohort=()
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
Strict-Transport-Security: max-age=63072000
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Request-Id: 01GXPDQYNRT1RCM8WHNRVTZJSQ
X-Runtime: 0.090365
X-Ua-Compatible: IE=edge
X-Xss-Protection: 1; mode=block
Edited by 🤖 GitLab Bot 🤖