Skip to content

HTML output in API Responses with ENABLE_GZIP #7714

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
1 task done
lystor opened this issue Aug 2, 2019 · 4 comments
Closed
1 task done

HTML output in API Responses with ENABLE_GZIP #7714

lystor opened this issue Aug 2, 2019 · 4 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@lystor
Copy link

lystor commented Aug 2, 2019

  • Gitea version: 1.9.0
  • Operating system: official Docker image gitea/gitea:1.9.0
  • Database (use [x]):
    • SQLite

Description

Hello

With enabled GZIP compression Gitea adds HTML rendered page after JSON response.

Example:

$ curl -X GET "http://localhost/api/v1/orgs/xxx" -H "accept: application/json" -H "authorization: Basic ZnJhZzpmcmFn"

{"documentation_url":"http://localhost:3000/api/swagger","errors":null,"message":"Not Found"}
<!DOCTYPE html>
<html lang="en-US">
<head data-suburl="">
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<title>Internal Server Error -  Gitea: Git with a cup of tea</title>
	<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
...

app.ini:

APP_NAME = Gitea: Git with a cup of tea
RUN_MODE = prod
RUN_USER = git

[repository]
ROOT = /data/git/repositories

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

[repository.upload]
TEMP_PATH = /data/gitea/uploads

[server]
ENABLE_GZIP      = true
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = localhost
HTTP_PORT        = 3000
ROOT_URL         = http://localhost:3000/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
DOMAIN           = localhost
LFS_JWT_SECRET   = v4Zc5M9iJBGQrwHehx7hwESS4BcCrr0U1imKq-RDJV4
OFFLINE_MODE     = false

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = sqlite3
HOST     = localhost:3306
NAME     = gitea
USER     = root
PASSWD   =
SSL_MODE = disable
CHARSET  = utf8

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER        = file

[picture]
AVATAR_UPLOAD_PATH            = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
DISABLE_GRAVATAR              = false
ENABLE_FEDERATED_AVATAR       = true

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log
MODE      = file
LEVEL     = info

[security]
INSTALL_LOCK   = true
SECRET_KEY     = fG84S9WOKdGg4XkEIokaV7pfzKxjEZb0A4vipQts1QnWKsK7oCjL36OMEM1WmLFZ
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NjQ3MzY2NTh9.WO3Ly5BSw-BgbnlerAOY0l8RqTjNsy0wKr6bwPC-V4Q

[service]
DISABLE_REGISTRATION              = false
REQUIRE_SIGNIN_VIEW               = false
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.example.org

[oauth2]
JWT_SECRET = nKYwg2CFn6XvyjvqO-ezrvxb9Zw8BxTJ6oAafSguIec

[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

Please fix this bug.
Thank you

@zeripath
Copy link
Contributor

zeripath commented Aug 2, 2019

We need the log information too.

@lunny lunny added the type/bug label Aug 3, 2019
@stale
Copy link

stale bot commented Oct 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Oct 2, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Oct 2, 2019
@stale stale bot removed the issue/stale label Oct 2, 2019
@zeripath
Copy link
Contributor

I can't reproduce this on master. @lystor does this still happen? Do you have any logs?

@zeripath zeripath added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Oct 11, 2019
@zeripath
Copy link
Contributor

I think this is the same problem as #9001 and it's fixed similarly.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

No branches or pull requests

3 participants