Welcome to mirror list, hosted at ThFree Co, Russian Federation.

auxiliary.go « handlers « internal - gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 443e641624b02a32e6150b1cb120f8abfa5d8eb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package handlers

import (
	"net/http"

	"gitlab.com/gitlab-org/gitlab-pages/internal/request"
)

func RedirectToHTTPS(w http.ResponseWriter, r *http.Request, statusCode int) {
	u := *r.URL
	u.Scheme = request.SchemeHTTPS
	u.Host = r.Host
	u.User = nil

	http.Redirect(w, r, u.String(), statusCode)
}