Skip to content

Commit

Permalink
Automatically add http:// to homepage URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Jun 11, 2019
1 parent 879d9bb commit 1ddcff7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/offer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ type offerResponse struct {

// Offer sends an offer API request.
func Offer(licensor *data.Licensor, homepage, description string, private, relicense uint) (string, error) {
if !strings.HasPrefix(homepage, "https://") && !strings.HasPrefix(homepage, "http://") {
homepage = "http://" + homepage
}
bodyData := offerRequest{
Action: "offer",
LicensorID: licensor.LicensorID,
Expand Down

0 comments on commit 1ddcff7

Please sign in to comment.