Skip to content

Download file /assets/img/gogs.ico failed #35790

@dangjinghao

Description

@dangjinghao

Description

That's too wired, the file /assets/img/gogs.ico couldn't be completely downloaded and displayed in Gitea 1.25.0 and Gitea demo website 1.26.0+dev-91-g39c08ce4c1.

Access https://demo.gitea.com/assets/img/gogs.ico directly via browser and the console warns net::ERR_HTTP2_PROTOCOL_ERROR 200 (OK).

execute curl -vv https://demo.gitea.com/assets/img/gogs.ico > /dev/null and it outputs:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 2600:1f14:b94:3b00:f434:fb42:37d1:4d43:443...
*   Trying 52.40.189.212:443...
* Connected to demo.gitea.com (52.40.189.212) port 443 (#0)
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/pki/tls/certs/ca-bundle.crt
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.2 (IN), TLS header, Certificate Status (22):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.2 (IN), TLS header, Finished (20):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [15 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2040 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* TLSv1.2 (OUT), TLS header, Finished (20):
} [5 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS header, Unknown (23):
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=demo.gitea.com
*  start date: Sep 15 20:01:51 2025 GMT
*  expire date: Dec 14 20:01:50 2025 GMT
*  subjectAltName: host "demo.gitea.com" matched cert's "demo.gitea.com"
*  issuer: C=US; O=Let's Encrypt; CN=E8
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Unknown (23):
} [5 bytes data]
* TLSv1.2 (OUT), TLS header, Unknown (23):
} [5 bytes data]
* TLSv1.2 (OUT), TLS header, Unknown (23):
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x556a429b36c0)
* TLSv1.2 (OUT), TLS header, Unknown (23):
} [5 bytes data]
> GET /assets/img/gogs.ico HTTP/2
> Host: demo.gitea.com
> user-agent: curl/7.76.1
> accept: */*
> 
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [122 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
* TLSv1.2 (OUT), TLS header, Unknown (23):
} [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
< HTTP/2 200 
< accept-ranges: bytes
< alt-svc: h3=":443"; ma=2592000
< cache-control: public, max-age=21600, no-transform
< content-type: image/png
< date: Thu, 30 Oct 2025 07:59:01 GMT
< last-modified: Wed, 29 Oct 2025 15:59:12 GMT
< server: Caddy
< content-length: 29157
< 
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Unknown (23):
{ [5 bytes data]
* transfer closed with 512 bytes remaining to read
* stopped the pause stream!
 98 29157   98 28645    0     0  49133      0 --:--:-- --:--:-- --:--:-- 49049
* Connection #0 to host demo.gitea.com left intact
curl: (18) transfer closed with 512 bytes remaining to read

In local selfhost Gitea 1.25.0, execute curl -vv http://localhost:3000/assets/img/gogs.ico > /dev/null and it outputs:

07:51:31.936743 [0-0] * Host localhost:3000 was resolved.
07:51:31.936794 [0-0] * IPv6: ::1
07:51:31.936824 [0-0] * IPv4: 127.0.0.1
07:51:31.936858 [0-0] * [SETUP] added
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     007:51:31.937187 [0-0] *   Trying [::1]:3000...
07:51:31.937271 [0-0] * [SETUP] Curl_conn_connect(block=0) -> 0, done=0
07:51:31.937317 [0-0] * [SETUP] Curl_conn_connect(block=0) -> 0, done=1
07:51:31.937356 [0-0] * Established connection to localhost (::1 port 3000) from ::1 port 36704 
07:51:31.937386 [0-0] * [SETUP] query ALPN
07:51:31.937418 [0-0] * using HTTP/1.x
07:51:31.937488 [0-0] > GET /assets/img/gogs.ico HTTP/1.1
07:51:31.937488 [0-0] > Host: localhost:3000
07:51:31.937488 [0-0] > User-Agent: curl/8.16.0
07:51:31.937488 [0-0] > Accept: */*
07:51:31.937488 [0-0] > 
07:51:31.937680 [0-0] * Request completely sent off
07:51:31.937885 [0-0] < HTTP/1.1 200 OK
07:51:31.937925 [0-0] < Accept-Ranges: bytes
07:51:31.937960 [0-0] < Cache-Control: max-age=0, public, must-revalidate, no-transform
07:51:31.937994 [0-0] < Content-Length: 29157
07:51:31.938026 [0-0] < Content-Type: image/png
07:51:31.938060 [0-0] < Last-Modified: Wed, 29 Oct 2025 16:57:43 GMT
07:51:31.938094 [0-0] < X-Gitea-Debug: RUN_MODE=dev, MaxAge=6h0m0s
07:51:31.938127 [0-0] < Date: Thu, 30 Oct 2025 07:51:31 GMT
07:51:31.938162 [0-0] < 
07:51:31.938194 [0-0] { [28645 bytes data]
07:51:31.938264 [0-0] * end of response with 512 bytes missing
 98 29157   98 28645    0     0  17.3M      0 --:--:-- --:--:-- --:--:-- 27.3M
07:51:31.938413 [0-0] * closing connection #0
curl: (18) end of response with 512 bytes missing

Access this URL via browser and the console warns net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK).

In Gitea 1.24.7 and gitea.com, it works.

Gitea Version

1.25.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

demo website screenshots:
Image
Access this URL via browser:
Image

Git Version

No response

Operating System

No response

How are you running Gitea?

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions