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

x/pkgsite: Badge generator creates wrong links if provided with HTTP scheme #43458

Closed
botherder opened this issue Jan 1, 2021 · 1 comment
Closed
Assignees
Labels

Comments

@botherder
Copy link

@botherder botherder commented Jan 1, 2021

What is the URL of the page with the issue?

https://pkg.go.dev/badge/

What did you do?

I entered a URL to a GitHub repository for a Go project of mine, but inclusive of the scheme https://.

What did you expect to see?

A badge URL correctly generated with the scheme stripped but github.com maintained in the URI to the reference page for the repository.

What did you see instead?

If you enter a full URL to a GitHub repo for your Go project, including the HTTP scheme, the badge generator will strip the domain name. For example:
https://pkg.go.dev/badge/?path=https://github.com/golang/go

Will generate:

[![Go Reference](https://pkg.go.dev/badge/golang/go.svg)](https://pkg.go.dev/golang/go)

While I imagine it is expected to provide a URL without scheme as with Go imports, the resulting stripping of the domain name is counter intuitive and an issue some might not notice straight away.

@gopherbot gopherbot added the pkgsite label Jan 1, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jan 1, 2021
@jba jba added the NeedsFix label Jan 5, 2021
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Jan 5, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Jan 5, 2021

Change https://golang.org/cl/281712 mentions this issue: content,internal: badges form improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants