Skip to content

Commit bebc0a0

Browse files
authored
Merge pull request #213 from plural/krakend-cache-hour
Krakend cache hour
2 parents a23f8ae + eb95ff5 commit bebc0a0

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

lib/tasks/krakend.rake

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ namespace :krakend do
3030
],
3131
"allow_credentials" => true,
3232
"allow_headers" => [
33-
"Accept-Language"
33+
"Accept-Language",
34+
"Authorization",
35+
"X-Forwarded-For",
36+
"X-Forwarded-Host",
37+
"X-Forwarded-Proto"
3438
]
3539
}
3640
},
@@ -53,7 +57,12 @@ namespace :krakend do
5357
"host": [ api_url ],
5458
}
5559
],
56-
"input_headers": [ "Authorization" ]
60+
"input_headers": [
61+
"Authorization",
62+
"X-Forwarded-For",
63+
"X-Forwarded-Host",
64+
"X-Forwarded-Proto"
65+
]
5766
},
5867
{
5968
"endpoint": "/assets/apitome/{resource}",
@@ -66,7 +75,12 @@ namespace :krakend do
6675
"sd": "static"
6776
}
6877
],
69-
"input_headers": [ "Authorization" ]
78+
"input_headers": [
79+
"Authorization",
80+
"X-Forwarded-For",
81+
"X-Forwarded-Host",
82+
"X-Forwarded-Proto"
83+
]
7084
},
7185
{
7286
"endpoint": "/assets/apitome/highlight_themes/{theme}",
@@ -80,7 +94,10 @@ namespace :krakend do
8094
}
8195
],
8296
"input_headers": [
83-
"Authorization"
97+
"Authorization",
98+
"X-Forwarded-For",
99+
"X-Forwarded-Host",
100+
"X-Forwarded-Proto"
84101
]
85102
},
86103
{
@@ -95,7 +112,10 @@ namespace :krakend do
95112
}
96113
],
97114
"input_headers": [
98-
"Authorization"
115+
"Authorization",
116+
"X-Forwarded-For",
117+
"X-Forwarded-Host",
118+
"X-Forwarded-Proto"
99119
]
100120
},
101121
],
@@ -121,8 +141,11 @@ namespace :krakend do
121141
}
122142
],
123143
"input_query_strings" => [ "*" ],
124-
"input_headers" => [
125-
"Authorization"
144+
"input_headers": [
145+
"Authorization",
146+
"X-Forwarded-For",
147+
"X-Forwarded-Host",
148+
"X-Forwarded-Proto"
126149
]
127150
}
128151
end
@@ -146,7 +169,9 @@ namespace :krakend do
146169
def build_public_endpoints(api_server_host, url_base, methods)
147170
endpoints = []
148171
methods.each do |m|
149-
endpoints << build_base_endpoint(api_server_host, url_base, m)
172+
endpoint = build_base_endpoint(api_server_host, url_base, m)
173+
endpoint['cache_ttl'] = '1h'
174+
endpoints << endpoint
150175
end
151176
return endpoints
152177
end

0 commit comments

Comments
 (0)