Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-sheng committed Dec 12, 2024
1 parent 7e05fed commit 4e935d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/en/status/query_ttl_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This API also provides the response in JSON format, which is more friendly for p

```shell
> curl -X GET "http://127.0.0.1:12800/status/config/ttl" \
-H "Content-Type: application/json"
-H "Accept: application/json"

{
"metrics": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.skywalking.oap.query.debug;

import com.linecorp.armeria.common.HttpHeaderNames;
import com.linecorp.armeria.common.HttpRequest;
import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.MediaType;
Expand Down Expand Up @@ -49,7 +50,7 @@ private TTLStatusQuery getTTLStatusQuery() {

@Get("/status/config/ttl")
public HttpResponse affectedTTLConfigurations(HttpRequest request) {
if ("application/json".equalsIgnoreCase(request.headers().get("content-type"))) {
if ("application/json".equalsIgnoreCase(request.headers().get(HttpHeaderNames.ACCEPT))) {
return HttpResponse.of(MediaType.JSON_UTF_8, getTTLStatusQuery().getTTL().generateTTLDefinitionAsJSONStr());
}
return HttpResponse.of(MediaType.PLAIN_TEXT_UTF_8, getTTLStatusQuery().getTTL().generateTTLDefinition());
Expand Down

0 comments on commit 4e935d8

Please sign in to comment.