Skip to content

Commit 42a531c

Browse files
committed
Fix
1 parent fb8bc98 commit 42a531c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* [Break Change] Change `compomentId` to `componentIds` in the K8SServiceRelation Scope.
2222
* Adapt the mesh metrics if detect the ambient mesh in the eBPF access log receiver.
2323
* Add JSON format support for the `/debugging/config/dump` status API.
24+
* Enhance status APIs to support multiple `accept` header values, e.g. `Accept: application/json; charset=utf-8`.
2425

2526
#### UI
2627

oap-server/server-query-plugin/status-query-plugin/src/main/java/org/apache/skywalking/oap/query/debug/DebuggingHTTPHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ public DebuggingHTTPHandler(final ModuleManager manager, final StatusQueryConfig
112112

113113
@Get("/debugging/config/dump")
114114
public String dumpConfigurations(HttpRequest request) {
115-
if ("application/json".equalsIgnoreCase(request.headers().get(HttpHeaderNames.ACCEPT))) {
115+
final String acceptHeader = request.headers().get(HttpHeaderNames.ACCEPT);
116+
if (acceptHeader != null && acceptHeader.toLowerCase().contains("application/json")) {
116117
return serverStatusService.dumpBootingConfigurations(config.getKeywords4MaskingSecretsOfConfig())
117118
.toJsonString();
118119
}

oap-server/server-query-plugin/status-query-plugin/src/main/java/org/apache/skywalking/oap/query/debug/TTLConfigQueryHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ private TTLStatusQuery getTTLStatusQuery() {
5050

5151
@Get("/status/config/ttl")
5252
public HttpResponse affectedTTLConfigurations(HttpRequest request) {
53-
if ("application/json".equalsIgnoreCase(request.headers().get(HttpHeaderNames.ACCEPT))) {
53+
final String acceptHeader = request.headers().get(HttpHeaderNames.ACCEPT);
54+
if (acceptHeader != null && acceptHeader.toLowerCase().contains("application/json")) {
5455
return HttpResponse.of(MediaType.JSON_UTF_8, getTTLStatusQuery().getTTL().generateTTLDefinitionAsJSONStr());
5556
}
5657
return HttpResponse.of(MediaType.PLAIN_TEXT_UTF_8, getTTLStatusQuery().getTTL().generateTTLDefinition());

0 commit comments

Comments
 (0)