Skip to content
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

Stalled PUT request for /repos/{owner}/{repo}/contents/{filepath} #10821

Closed
2 of 7 tasks
claudius108 opened this issue Mar 25, 2020 · 3 comments
Closed
2 of 7 tasks

Stalled PUT request for /repos/{owner}/{repo}/contents/{filepath} #10821

claudius108 opened this issue Mar 25, 2020 · 3 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@claudius108
Copy link

  • Gitea version (or commit ref):
  • Git version: Gitea version 1.12.0+dev-32-gdcaa5643d built with GNU Make 3.81, go1.13.5 : bindata, sqlite, sqlite_unlock_notify
  • Operating system: Ubuntu 14.04.6 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I want to update a file, and the connection looks stalled both from javascript and with CURL.
`curl -v -X PUT “path-to-host-and-file” -H “accept: application/json” -H “Content-Type: application/json” -H “Authorization: token …” -d ‘{“content”:“content in base64 format”,“message”:“Updated file uuid-74f5ca75-7022-4c7c-b5ca-7570225c7c55”,“author”:{“email”:“email”,“name”:“name”}}’ -i

Trying host…
TCP_NODELAY set
Connected to host (host) port 3000 (#0)

PUT /api/v1/repos/path-to-file HTTP/1.1
Host: host:3000
User-Agent: curl/7.58.0
accept: application/json
Content-Type: application/json
Authorization: token …
Content-Length: 6340
Expect: 100-continue

< HTTP/1.1 100 Continue
HTTP/1.1 100 Continue

We are completely uploaded and fine

`

Is there any setting for gitea I should make? Gitea is behind caddy.

Thanks,
Claudius

@guillep2k guillep2k added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Mar 26, 2020
@6543
Copy link
Member

6543 commented Apr 6, 2020

Hello @claudius108,

Based on your curl comand, your API call is missing the "branch" and the "sha" field both are required.

but if those are missing the api should return Status 422 or 500 (witch is a bug #10982) but not 100.

can you test the api calls without caddy?

@claudius108
Copy link
Author

Hi,

Thank you, looks like the branch was missing (I used the sha, but I did not mentioned it above). From API description I thought branch is optional:
branch (optional) to base this file from. if not given, the default branch is used

Thanks again,
Claudius

@6543
Copy link
Member

6543 commented Apr 7, 2020

@claudius108 thansk for the info for the wrong docuentation
I'll make it optionall if i have time to create a pull

issue: #11006

@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
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

3 participants