Skip to content

Not able to go get a repository with non-80 port #5305

@retgits

Description

@retgits

Description

Executing go get on a repository hosted by gogs fails with an error

Fetching https://myserver:3000/myUser/myProject?go-get=1
Parsing meta tags from https://myserver:3000/myUser/myProject?go-get=1 (status code 200)
package myserver:3000/myUser/myProject: unrecognized import path "myserver:3000/myUser/myProject" (parse https://myserver:3000/myUser/myProject?go-get=1: no go-import meta tags (meta tag myserver/myUser/myProject did not match import path myserver:3000/myUser/myProject))

It could be that because my gogs server uses a different port that the template used to generate the go-import meta tags don't properly get that port.

The other thing I noticed is that when I browse to the url https://myserver:3000/myUser/myProject?go-get=1 it returns the entire HTML code in the body tag as opposed to it being the actual response:

<html class=""><head></head><body data-gr-c-s-loaded="true"><pre style="word-wrap: break-word; white-space: pre-wrap;">&lt;!doctype html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;meta name="go-import" content="myserver/myUser/myProject git https://myserver:3000/myUser/myProject.git"&gt;
		&lt;meta name="go-source" content="myserver/myUser/myProject _ https://myserver:3000/myUser/myProject/src/master{/dir} https://myserver:3000/myUser/myProject/src/master{/dir}/{file}#L{line}"&gt;
	&lt;/head&gt;
	&lt;body&gt;
		go get myserver/myUser/myProject
	&lt;/body&gt;
&lt;/html&gt;
</pre></body></html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions