Skip to content

Commit b03f21f

Browse files
committed
Fix Let's Encrypt issue
1 parent eca1dad commit b03f21f

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

glide.lock

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import:
1414
version: 7abdd30a878efb3673ce4dfe0070570a6c9444c8
1515
subpackages:
1616
- lnrpc
17-
- package: golang.org/x/crypto
17+
- package: github.com/golang/crypto
18+
version: 3d37316aaa6bd9929127ac9a527abf408178ea7b
1819
subpackages:
1920
- acme/autocert
2021
- package: google.golang.org/grpc

main.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"reflect"
1414
"time"
1515

16-
"golang.org/x/crypto/acme/autocert"
16+
"github.com/golang/crypto/acme/autocert"
1717

1818
"github.com/gorilla/mux"
1919
)
@@ -157,14 +157,7 @@ func main() {
157157

158158
// As we'd like all requests to default to https, redirect all regular
159159
// http requests to the https version of the faucet.
160-
go http.ListenAndServe(":80", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
161-
targetURL := "https://" + r.Host + r.URL.String()
162-
if len(r.URL.RawQuery) > 0 {
163-
targetURL += "?" + r.URL.RawQuery
164-
}
165-
166-
http.Redirect(w, r, targetURL, http.StatusPermanentRedirect)
167-
}))
160+
go http.ListenAndServe(":80", m.HTTPHandler(nil))
168161

169162
// Finally, create the http server, passing in our TLS configuration.
170163
httpServer := &http.Server{

0 commit comments

Comments
 (0)