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

404 error if you try to clone a repo without .git #4189

Closed
ogarcia opened this issue Feb 24, 2017 · 2 comments
Closed

404 error if you try to clone a repo without .git #4189

ogarcia opened this issue Feb 24, 2017 · 2 comments
Labels
🔨 enhancement Make it better, faster
Milestone

Comments

@ogarcia
Copy link
Contributor

ogarcia commented Feb 24, 2017

In previous versions of gogs (in 0.9.141 or early) you can clone a repo without .git at end. For example you can do:

git clone https://try.gogs.io/testador/test

And it works.

In 0.10 RC if you do this action you have a 404 error.

% GIT_CURL_VERBOSE=1 git clone https://try.gogs.io/testador/test
Cloning into 'test'...
* Couldn't find host try.gogs.io in the .netrc file; using defaults
*   Trying 159.203.18.145...
* TCP_NODELAY set
* Connected to try.gogs.io (159.203.18.145) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=try.gogs.io
*  start date: Feb 11 06:14:00 2017 GMT
*  expire date: May 12 06:14:00 2017 GMT
*  subjectAltName: host "try.gogs.io" matched cert's "try.gogs.io"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /testador/test/info/refs?service=git-upload-pack HTTP/1.1
Host: try.gogs.io
User-Agent: git/2.11.1
Accept: */*
Accept-Encoding: gzip
Accept-Language: es-ES, *;q=0.9
Pragma: no-cache

< HTTP/1.1 404 Not Found
< Content-Type: text/html; charset=UTF-8
< Date: Fri, 24 Feb 2017 15:39:20 GMT
< Server: Caddy
< Set-Cookie: lang=es-ES; Path=/; Max-Age=2147483647
< Set-Cookie: i_like_gogits=b5121edb23db23be; Path=/; HttpOnly
< Set-Cookie: _csrf=y5fS3JIF28uv3TVTVeLzURsh9rU6MTQ4Nzk1MDc2MDIxOTEyMDQ0NA%3D%3D; Path=/; Expires=Sat, 25 Feb 2017 15:39:20 GMT; HttpOnly
< Transfer-Encoding: chunked
< 
* Curl_http_done: called premature == 0
* Connection #0 to host try.gogs.io left intact
fatal: repository 'https://try.gogs.io/testador/test/' not found

There is a change added between 0.9.141 and 0.10 RC that broke this.

@unknwon unknwon added the 🔨 enhancement Make it better, faster label Feb 24, 2017
@unknwon unknwon added this to the 0.11 milestone Mar 5, 2017
@unknwon unknwon added the status: needs feedback Tell me more about it label Mar 5, 2017
unknwon added a commit that referenced this issue Mar 5, 2017
Sometimes user could simply request wrong URL, but if that wrong URL
has nothing related Git HTTP operations, HTTP Basic Authentication
should not prompted. Instead, clean 404 page should be presented.

The patch also supports Git HTTP operations without '.git' suffix
to the repository name, which addresses #4226 and #4189.
@unknwon
Copy link
Member

unknwon commented Mar 5, 2017

Patch has pushed to fix this issue, please test on develop branch or https://try.gogs.io.

@ogarcia
Copy link
Contributor Author

ogarcia commented Mar 5, 2017

It works perfect! 👍

@unknwon unknwon removed the status: needs feedback Tell me more about it label Mar 5, 2017
@unknwon unknwon closed this as completed Mar 5, 2017
richmahn referenced this issue in unfoldingWord/dcs Feb 4, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 enhancement Make it better, faster
Projects
None yet
Development

No branches or pull requests

2 participants