referer to referrer

Gerasimos (Makis) Maropoulos 2020-06-11 04:16:35 +03:00
parent 6ad0e5ab5b
commit dd9142d529
No known key found for this signature in database
GPG Key ID: 5DBE766BD26A54E7
4 changed files with 21 additions and 20 deletions

@ -1,12 +1,13 @@
The HTTP referer(originally a misspelling of **referrer**) is an optional HTTP header field that identifies the address of the webpage (i.e. the URI or IRI) which is linked to the resource being requested. By checking the referrer, the new webpage can see where the request originated.
The Referrer-Policy HTTP header controls how much referrer information (sent via the Referer header) should be included with requests.
Read more at [wikipedia](https://en.wikipedia.org/wiki/HTTP_referer)
Read more at [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy)
--------
Iris uses the [Shopify's goreferrer](https://github.com/Shopify/goreferrer/pull/27) package to expose the `Context.GetReferrer()` method.
The `GetReferrer` Context's method extracts and returns the information from the `"Referer"` header as specified in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy or by the URL `query parameter "referer"`.
The `GetReferrer` method 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.
```go
GetReferrer() Referrer
@ -79,9 +80,9 @@ How to `curl`:
```sh
curl http://localhost:8080?\
referer=https://twitter.com/Xinterio/status/1023566830974251008
referrer=https://twitter.com/Xinterio/status/1023566830974251008
curl http://localhost:8080?\
referer=https://www.google.com/search?q=Top+6+golang+web+frameworks\
referrer=https://www.google.com/search?q=Top+6+golang+web+frameworks\
&oq=Top+6+golang+web+frameworks
```

@ -25,7 +25,7 @@ This wiki is the main source of documentation for **developers** working with (o
* [[API Versioning]]
* [[Content Negotiation]]
* [[Response Recorder]]
* [[HTTP Referer]]
* [[HTTP Referrer]]
* [[Request Authentication]]
* [[URL Query Parameters]]
* [[Forms]]

8
MVC.md

@ -55,7 +55,7 @@ func (m *MyController) BeforeActivation(b mvc.BeforeActivation) {
// 2-> Path
// 3-> The controller's function name to be parsed as handler
// 4-> Any handlers that should run before the MyCustomHandler
b.Handle("GET", "/something/{id:long}", "MyCustomHandler", anyMiddleware...)
b.Handle("GET", "/something/{id:int64}", "MyCustomHandler", anyMiddleware...)
}
// GET: http://localhost:8080/root
@ -63,7 +63,7 @@ func (m *MyController) Get() string {
return "Hey"
}
// GET: http://localhost:8080/root/something/{id:long}
// GET: http://localhost:8080/root/something/{id:int64}
func (m *MyController) MyCustomHandler(id int64) string {
return "MyCustomHandler says Hey"
}
@ -104,8 +104,8 @@ If `mvc.New(app.Party("/user")).Handle(new(user.Controller))`
- `func(*Controller) PostLogin()` - `POST:/user/login`
- `func(*Controller) GetProfileFollowers()` - `GET:/user/profile/followers`
- `func(*Controller) PostProfileFollowers()` - `POST:/user/profile/followers`
- `func(*Controller) GetBy(id int64)` - `GET:/user/{param:long}`
- `func(*Controller) PostBy(id int64)` - `POST:/user/{param:long}`
- `func(*Controller) GetBy(id int64)` - `GET:/user/{param:int64}`
- `func(*Controller) PostBy(id int64)` - `POST:/user/{param:int64}`
If `mvc.New(app.Party("/profile")).Handle(new(profile.Controller))`

@ -3,7 +3,7 @@
* [[Benchmarks]]
* [[Support]]
* [[Installing Iris|Installation]]
* [[Getting Started]]
* [[Getting Started|getting-started]]
* [[Host]]
* [[Automatic Public Domain with TLS|Automatic-public-address]]
* [[Configuration]]
@ -16,17 +16,17 @@
* [[Wrap the Router|Routing-wrap-the-router]]
* [[Override Context|Routing-override-context]]
* [[Context Methods|Routing-context-methods]]
* [[HTTP Method Override]]
* [[API Versioning]]
* [[Content Negotiation]]
* [[Response Recorder]]
* [[HTTP Referer]]
* [[Request Authentication]]
* [[URL Query Parameters]]
* [[HTTP Method Override|HTTP-method-override]]
* [[API Versioning|api-versioning]]
* [[Content Negotiation|content-negotiation]]
* [[Response Recorder|response-recorder]]
* [[HTTP Referrer|HTTP-referrer]]
* [[Request Authentication|Request-authentication]]
* [[URL Query Parameters|url-query-parameters]]
* [[Forms]]
* [[Model Validation]]
* [[Model Validation|model-validation]]
* [[Cache]]
* [[File Server]]
* [[File Server|file-server]]
* [[View]]
* [[Cookies]]
* [[Sessions]]