From 396a97c595a2a9963f3f3428a76a404e688df5bc Mon Sep 17 00:00:00 2001 From: Antonije Ivanovic Date: Thu, 9 Nov 2023 18:03:33 +0000 Subject: [PATCH] Fix for parsing use_h2c config In my [#694](https://github.com/luraproject/lura/pull/694) I fixed issued with h2c support and CORS. There was small bug which slipped through code review. New config field does not use correct struct tag. Changed `json` to `mapstructure`. Signed-off-by: Antonije Ivanovic --- config/config.go | 2 +- config/config_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 80c0f1d5b..26c2e5cee 100644 --- a/config/config.go +++ b/config/config.go @@ -161,7 +161,7 @@ type ServiceConfig struct { TLS *TLS `mapstructure:"tls"` // UseH2C enables h2c support. - UseH2C bool `json:"use_h2c"` + UseH2C bool `mapstructure:"use_h2c"` // run lura in debug mode Debug bool `mapstructure:"debug_endpoint"` diff --git a/config/config_test.go b/config/config_test.go index a9db9c741..0149c301d 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -211,7 +211,7 @@ func TestConfig_init(t *testing.T) { t.Error(err.Error()) } - if hash != "NILRcvZq9y+zinGtRRfG+Zm1ORVE3gI2gjpcgDI3A/Q=" { + if hash != "GdZTJtCn9ZHj3iBR1ZxmZL65HjbTCU8HhbDG8YWudAo=" { t.Errorf("unexpected hash: %s", hash) } }