Skip to content

[BUG] Response content-type changed in 2.11 for some endpoints #3718

@cwperks

Description

@cwperks

In 2.11, there was a change to introduce a SecurityResponse wrapper around a BytesRestResponse. In the method to cast the SecurityResponse to a RestResponse, the method creates a BytesRestResponse using the constructor without contentType. (Here's the BytesResponseResponse constructor for context). Even if an instance of SecurityResponse is created with a Content-Type header it is being ignored since the constructor of BytesRestResponse will set it at the time the RestResponse is instantiated.

APIs impacted:

  • /_plugins/security/api/authtoken
  • Any Unauthed call now responds with application/json instead of text/plain

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions