我们有多个环境,现在其中一个环境必须 return 以大写形式响应 header 而另一个以小写形式响应

We have multiple environments and right now one of the environment has to return response header in upper case and other in lower case

我要回复header大小写被忽略如何实现?

如果 content-type 是小写,它会在存在时将值打印为 null 但在大写时如何获得响应 header 因此它不区分大小写。

输出:

header--------- null 

我也试过了,但它总是只读取第一个条件

* def header = karate.get("responseHeaders['Content-Type'][0]" || "responseHeaders['content-type'][0]")

尝试阅读文档,搜索 lowerCaseResponseHeaders:

您可以找到使用示例 here

* configure lowerCaseResponseHeaders = true