mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
Changes after merging
This commit is contained in:
parent
42523ae9d9
commit
f72c2b85fd
@ -6,8 +6,15 @@ The format is based on [Keep a Changelog][keepachangelog] and this project adher
|
||||
|
||||
### UNRELEASED
|
||||
|
||||
### Changed
|
||||
|
||||
- Go updated from `1.17.5` up to `1.17.6`
|
||||
- Add "Host" and "X-Forwarded-For" Header to error pages
|
||||
|
||||
### Added
|
||||
|
||||
- `Host` and `X-Forwarded-For` Header to error pages [#61]
|
||||
|
||||
[#61]:https://github.com/tarampampam/error-pages/pull/61
|
||||
|
||||
## v2.4.0
|
||||
|
||||
|
@ -25,7 +25,7 @@ const (
|
||||
// RequestID is a unique ID that identifies the request - same as for backend service
|
||||
RequestID = "X-Request-ID"
|
||||
|
||||
// Forward-For identifies the user of this session
|
||||
// ForwardedFor identifies the user of this session
|
||||
ForwardedFor = "X-Forwarded-For"
|
||||
|
||||
// Host identifies the hosts origin
|
||||
|
@ -13,7 +13,7 @@ type Properties struct { // only string properties with a "token" tag, please
|
||||
ServicePort string `token:"service_port"`
|
||||
RequestID string `token:"request_id"`
|
||||
ForwardedFor string `token:"forwarded_for"`
|
||||
Host string `token:"host"`
|
||||
Host string `token:"host"`
|
||||
ShowRequestDetails bool
|
||||
}
|
||||
|
||||
|
@ -9,17 +9,17 @@ import (
|
||||
|
||||
func TestProperties_Replaces(t *testing.T) {
|
||||
props := tpl.Properties{
|
||||
Code: "foo",
|
||||
Message: "bar",
|
||||
Description: "baz",
|
||||
OriginalURI: "aaa",
|
||||
Namespace: "bbb",
|
||||
IngressName: "ccc",
|
||||
ServiceName: "ddd",
|
||||
ServicePort: "eee",
|
||||
RequestID: "fff",
|
||||
ForwardedFor:"ggg",
|
||||
Host: "hhh",
|
||||
Code: "foo",
|
||||
Message: "bar",
|
||||
Description: "baz",
|
||||
OriginalURI: "aaa",
|
||||
Namespace: "bbb",
|
||||
IngressName: "ccc",
|
||||
ServiceName: "ddd",
|
||||
ServicePort: "eee",
|
||||
RequestID: "fff",
|
||||
ForwardedFor: "ggg",
|
||||
Host: "hhh",
|
||||
}
|
||||
|
||||
r := props.Replaces()
|
||||
|
@ -7,6 +7,8 @@ X-Ingress-Name: baz
|
||||
X-Service-Name: aaa
|
||||
X-Service-Port: bbb
|
||||
X-Request-ID: ccc
|
||||
X-Forwarded-For: ddd
|
||||
Host: eee
|
||||
|
||||
HTTP/* 200
|
||||
|
||||
@ -23,6 +25,8 @@ jsonpath "$.details.ingress_name" == "baz"
|
||||
jsonpath "$.details.service_name" == "aaa"
|
||||
jsonpath "$.details.service_port" == "bbb"
|
||||
jsonpath "$.details.request_id" == "ccc"
|
||||
jsonpath "$.details.forwarded_for" == "ddd"
|
||||
jsonpath "$.details.host" == "eee"
|
||||
jsonpath "$.details.timestamp" isInteger
|
||||
|
||||
# X-Format in the action
|
||||
|
@ -7,6 +7,8 @@ X-Ingress-Name: baz
|
||||
X-Service-Name: aaa
|
||||
X-Service-Port: bbb
|
||||
X-Request-ID: ccc
|
||||
X-Forwarded-For: ddd
|
||||
Host: eee
|
||||
|
||||
HTTP/* 200
|
||||
|
||||
@ -23,7 +25,7 @@ xpath "string(//error/details/serviceName)" == "aaa"
|
||||
xpath "string(//error/details/servicePort)" == "bbb"
|
||||
xpath "string(//error/details/requestID)" == "ccc"
|
||||
xpath "string(//error/details/forwardedFor)" == "ddd"
|
||||
xpath "string(//error/details/host)" == "fff"
|
||||
xpath "string(//error/details/host)" == "eee"
|
||||
xpath "string(//error/details/timestamp)" exists
|
||||
|
||||
# X-Format in the action
|
||||
|
Loading…
Reference in New Issue
Block a user