Skip to content

The timezone in the last-modified header is specified incorrectly. #31930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
phi-friday opened this issue Aug 28, 2024 · 0 comments · Fixed by #32102
Closed

The timezone in the last-modified header is specified incorrectly. #31930

phi-friday opened this issue Aug 28, 2024 · 0 comments · Fixed by #32102
Labels
Milestone

Comments

@phi-friday
Copy link

phi-friday commented Aug 28, 2024

Description

The date uses utc, but the calculated time was entered correctly.
However, last-modified is the correct time, but the timezone is specified as utc.
The same goes for the if-modified-since header in request.
The current time is 2024-08-28T04:24:31.699596+00:00,
so the last modified time of Wed, 28 Aug 2024 13:08:50 GMT is obviously wrong.

Gitea Version

1.22.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

url: https://<some domain>/<owner>/<repo>/src/branch/main/<sub paths...>/<some file>

스크린샷 2024-08-28 오후 1 14 12

url: https://<some domain>/<owner>/<repo>/raw/branch/main/<sub paths...>/<some file>

스크린샷 2024-08-28 오후 1 14 30

Git Version

No response

Operating System

No response

How are you running Gitea?

services:
  repository:
    container_name: git-server
    image: gitea/gitea:1.22.1
    restart: always
    env_file:
      - .env
    ports:
      - "127.0.0.1:${GITEA_SSH_PORT}:22"
    networks:
      - public-network
    command:
      - sh
      - -c
      - |
        sh /init.sh
        /bin/s6-svscan /etc/s6
    environment:
      - TZ=Asia/Seoul
    volumes:
      - git-server:/data
      - type: bind
        source: "/home/${GITEA_SSH_USER_NAME}/.ssh"
        target: "/data/git/.ssh"
        read_only: false
      - type: bind
        source: "./app.ini.default"
        target: "${GITEA_APP_DEFAULT_PATH}"
        read_only: true
      - type: bind
        source: "./init.sh"
        target: "/init.sh"
        read_only: true
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
    extra_hosts:
      - ${COMMON_PROXY_LOCAL_HOST}:host-gateway
      - ${COMMON_ADDITIONAL_PROXY_LOCAL_HOST}:host-gateway
    logging:
      options:
        max-size: 10m
        max-file: 1

Database

PostgreSQL

@lunny lunny added this to the 1.22.3 milestone Sep 21, 2024
lunny added a commit that referenced this issue Sep 22, 2024
Backport #32102 by @lunny

Fix #31930 and more places which use `http.TimeFormat` wrongly.
`http.TimeFormat` requires a UTC time. refer to
https://pkg.go.dev/net/http#TimeFormat

Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants