我使用以下给定的属性启用了管理端点,包括 httptrace。
management.endpoints.web.exposure.include=*
但使用http://localhost:8081/actuator/httptrace
请求正文参数未响应
{
"traces": [
{
"timestamp": "2019-02-15T01:39:50.595Z",
"principal": null,
"session": null,
"request": {
"method": "POST",
"uri": "http://localhost:8080/hi",
"headers": {
"content-length": [
"15"
],
"postman-token": [
"82b0e3eb-6359-4d06-980c-669e553ef5b8"
],
"host": [
"localhost:8080"
],
"connection": [
"keep-alive"
],
"content-type": [
"application/json"
],
"cache-control": [
"no-cache"
],
"accept-encoding": [
"gzip, deflate"
],
"accept": [
"*/*"
],
"user-agent": [
"PostmanRuntime/7.6.0"
]
},
"remoteAddress": null
},
"response": {
"status": 200,
"headers": {}
},
"timeTaken": 1
}
]
Run Code Online (Sandbox Code Playgroud)
}
我的目标是为我的 Spring Boot 应用程序禁用 HTTP TRACE 方法,该应用程序使用嵌入式 undertow。
最好进行有效的 yaml 更改,如果没有,更改代码也可以。理想情况下,最终结果应该是 4xx HTTP 响应代码,并且响应中没有 cookie 值。[spring.mvc.dispatch-trace-request: false 给出 200 OK,所以这对我没有好处。]
打破我的头,不应该这么难!