diff --git a/Makefile b/Makefile index 95c5f0a4..cbbd0339 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BIN_NAME :=krakend OS := $(shell uname | tr '[:upper:]' '[:lower:]') -VERSION := 1.3.0 +VERSION := 1.4.0 PKGNAME := krakend LICENSE := Apache 2.0 VENDOR= @@ -18,7 +18,7 @@ DESC := High performance API gateway. Aggregate, filter, manipulate and add midd MAINTAINER := Daniel Ortiz DOCKER_WDIR := /tmp/fpm DOCKER_FPM := devopsfaith/fpm -GOLANG_VERSION := 1.15.8 +GOLANG_VERSION := 1.16.4 FPM_OPTS=-s dir -v $(VERSION) -n $(PKGNAME) \ --license "$(LICENSE)" \ diff --git a/tests/fixtures/specs/backend_301.json b/tests/fixtures/specs/backend_301.json index 79a62eed..f8bec94d 100644 --- a/tests/fixtures/specs/backend_301.json +++ b/tests/fixtures/specs/backend_301.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=301\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"301\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=301\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"301\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/backend_302.json b/tests/fixtures/specs/backend_302.json index 2882b920..af96c7c5 100644 --- a/tests/fixtures/specs/backend_302.json +++ b/tests/fixtures/specs/backend_302.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=302\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"302\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=302\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"302\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/backend_303.json b/tests/fixtures/specs/backend_303.json index 4d288422..17e919ee 100644 --- a/tests/fixtures/specs/backend_303.json +++ b/tests/fixtures/specs/backend_303.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=303\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"303\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=303\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"303\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/backend_307.json b/tests/fixtures/specs/backend_307.json index 49f5dd3b..cfe79162 100644 --- a/tests/fixtures/specs/backend_307.json +++ b/tests/fixtures/specs/backend_307.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=307\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"307\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Referer\":[\"http://127.0.0.1:8081/redirect/?status=307\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{\"status\":[\"307\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/cors_5.json b/tests/fixtures/specs/cors_5.json index ba57cae6..fa629016 100644 --- a/tests/fixtures/specs/cors_5.json +++ b/tests/fixtures/specs/cors_5.json @@ -9,12 +9,12 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], "X-Krakend-Completed": ["true"], - "X-Krakend": ["Version 1.3.0"], + "X-Krakend": ["Version 1.4.0"], "Vary": ["Origin","Origin"], "Access-Control-Allow-Origin": ["*"], "Access-Control-Expose-Headers": ["Content-Length"] diff --git a/tests/fixtures/specs/detail_error.json b/tests/fixtures/specs/detail_error.json index 6238f0c9..8ed81bc3 100644 --- a/tests/fixtures/specs/detail_error.json +++ b/tests/fixtures/specs/detail_error.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"error_backend_b\":{\"http_status_code\":404,\"http_body\":\"404 page not found\\n\"},\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{}}", + "body": "{\"error_backend_b\":{\"http_status_code\":404,\"http_body\":\"404 page not found\\n\"},\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": [""], diff --git a/tests/fixtures/specs/no-op.json b/tests/fixtures/specs/no-op.json index 880d7456..5bd6a15d 100644 --- a/tests/fixtures/specs/no-op.json +++ b/tests/fixtures/specs/no-op.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Content-Length\":[\"0\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{}}\n", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Content-Length\":[\"0\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/\",\"query\":{}}\n", "header": { "content-type": ["application/json"], "Cache-Control": [""], diff --git a/tests/fixtures/specs/param_forwarding_1.json b/tests/fixtures/specs/param_forwarding_1.json index 5b2983c3..3b510218 100644 --- a/tests/fixtures/specs/param_forwarding_1.json +++ b/tests/fixtures/specs/param_forwarding_1.json @@ -10,7 +10,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/param_forwarding_2.json b/tests/fixtures/specs/param_forwarding_2.json index c7e562b8..091fd549 100644 --- a/tests/fixtures/specs/param_forwarding_2.json +++ b/tests/fixtures/specs/param_forwarding_2.json @@ -10,7 +10,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"A-B-C\":[\"ignore\"],\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"User-Agent\":[\"Go-http-client/1.1\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Forwarded-Via\":[\"KrakenD Version 1.3.0\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", + "body": "{\"foo\":42,\"headers\":{\"A-B-C\":[\"ignore\"],\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"User-Agent\":[\"Go-http-client/1.1\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Forwarded-Via\":[\"KrakenD Version 1.4.0\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/param_forwarding_3.json b/tests/fixtures/specs/param_forwarding_3.json index a47ddcc3..718197a6 100644 --- a/tests/fixtures/specs/param_forwarding_3.json +++ b/tests/fixtures/specs/param_forwarding_3.json @@ -10,7 +10,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/param_forwarding_4.json b/tests/fixtures/specs/param_forwarding_4.json index f667072f..6fc020e0 100644 --- a/tests/fixtures/specs/param_forwarding_4.json +++ b/tests/fixtures/specs/param_forwarding_4.json @@ -10,7 +10,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"Content-Length\":[\"0\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"Authorization\":[\"bearer 123456\"],\"Content-Length\":[\"0\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"],\"X-Y-Z\":[\"true\"]},\"path\":\"/param_forwarding/bar\",\"query\":{\"foo\":[\"foo\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/query_forwarding_1.json b/tests/fixtures/specs/query_forwarding_1.json index 69395af5..32549ea2 100644 --- a/tests/fixtures/specs/query_forwarding_1.json +++ b/tests/fixtures/specs/query_forwarding_1.json @@ -8,7 +8,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/foo\",\"query\":{\"a\":[\"1\"],\"b\":[\"2\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/foo\",\"query\":{\"a\":[\"1\"],\"b\":[\"2\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/query_forwarding_2.json b/tests/fixtures/specs/query_forwarding_2.json index d84ef222..2bf6afdc 100644 --- a/tests/fixtures/specs/query_forwarding_2.json +++ b/tests/fixtures/specs/query_forwarding_2.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/foo\",\"query\":{\"a\":[\"1\"],\"b\":[\"2\",\"3\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/foo\",\"query\":{\"a\":[\"1\"],\"b\":[\"2\",\"3\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/query_forwarding_3.json b/tests/fixtures/specs/query_forwarding_3.json index 1e22d366..0197f0d9 100644 --- a/tests/fixtures/specs/query_forwarding_3.json +++ b/tests/fixtures/specs/query_forwarding_3.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/foo\",\"query\":{\"a\":[\"1\"]}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/foo\",\"query\":{\"a\":[\"1\"]}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/sequential_1.json b/tests/fixtures/specs/sequential_1.json index 66f426e3..d85f84a0 100644 --- a/tests/fixtures/specs/sequential_1.json +++ b/tests/fixtures/specs/sequential_1.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/42\",\"query\":{}}", + "body": "{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/42\",\"query\":{}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": ["public, max-age=3600"], diff --git a/tests/fixtures/specs/timeout.json b/tests/fixtures/specs/timeout.json index b13403fe..d3f9b90c 100644 --- a/tests/fixtures/specs/timeout.json +++ b/tests/fixtures/specs/timeout.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "{\"first\":{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.3.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/123\",\"query\":{}}}", + "body": "{\"first\":{\"foo\":42,\"headers\":{\"Accept-Encoding\":[\"gzip\"],\"User-Agent\":[\"KrakenD Version 1.4.0\"],\"X-Forwarded-Host\":[\"localhost:8080\"]},\"path\":\"/param_forwarding/123\",\"query\":{}}}", "header": { "content-type": ["application/json; charset=utf-8"], "Cache-Control": [""], diff --git a/tests/fixtures/specs/xml_2.json b/tests/fixtures/specs/xml_2.json index 939d4314..a8a5c9e0 100644 --- a/tests/fixtures/specs/xml_2.json +++ b/tests/fixtures/specs/xml_2.json @@ -5,7 +5,7 @@ }, "out": { "status_code": 200, - "body": "42gziphttp://127.0.0.1:8081/param_forwardingKrakenD Version 1.3.0localhost:8080/param_forwarding/", + "body": "42gziphttp://127.0.0.1:8081/param_forwardingKrakenD Version 1.4.0localhost:8080/param_forwarding/", "header": { "content-type": ["application/xml"], "Cache-Control": ["public, max-age=3600"],