Skip to content

Getting raw files for private repos via token #13772

Closed
@pat-s

Description

@pat-s
  • Gitea version (or commit ref): 1.14.0+dev-290-gb1cf7f4df
  • Git version:
  • Operating system: -
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

When fetchting raw files of private repos, one needs to pass some form of authentication.
Usually ?token=<token> is appended or the token is passed via -u <username>:<token> in the request, e.g. in curl <URL>.

Works in GitHub when providing a token, returns a 404 without a token.

In Gitea however I see the following:

Without a token

curl https://try.gitea.io/pat-s/test/raw/branch/master/README.md

-> HTML response (expecting a 404)

With token

curl -u <username>:<token> https://try.gitea.io/pat-s/test/raw/branch/master/README.md

-> HTML response (expecting raw response)

With password

curl -u <username>:<password> https://try.gitea.io/pat-s/test/raw/branch/master/README.md

-> raw response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions