From 1ddcff7131381a0007d32c32b2d5f3b429d45cdf Mon Sep 17 00:00:00 2001 From: "Kyle E. Mitchell" Date: Mon, 10 Jun 2019 17:03:29 -0700 Subject: [PATCH] Automatically add http:// to homepage URLs --- api/offer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/offer.go b/api/offer.go index 61cb0aa..048a7ad 100644 --- a/api/offer.go +++ b/api/offer.go @@ -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,