1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 04:17:03 +00:00

minor: try to extract from both referer and referrer header and url query parameter

Former-commit-id: c0ed0916f35ee9cffe0b267e34d5708c1d38082b
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-06-11 01:58:35 +03:00
parent 07f678eac0
commit b4fcaab459
2 changed files with 18 additions and 10 deletions

View File

@@ -8,8 +8,8 @@ func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
// GetReferrer extracts and returns the information from the "Referrer" header as specified
// in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy or by the URL query parameter "referrer".
// GetReferrer extracts and returns the information from the "Referer" (or "Referrer") header
// and url query parameter as specified in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy.
r := ctx.GetReferrer()
switch r.Type {
case iris.ReferrerSearch: