nestia icon indicating copy to clipboard operation
nestia copied to clipboard

Content type of response changes randomly to text/plain (instead of application/json)

Open falkorotter opened this issue 5 months ago • 2 comments

Question

I use @TypedRoute.Get() in a controller to retrieve data. Usually I get as the expected content-type application/json but in random responses I get text/plain as content-type. If I use the default Nest.js decorator @Get() instead of @TypedRoute.Get(), the response always consistently has the expected content-type application/json. Is there an explanation for this behavior?

falkorotter avatar Jan 23 '24 20:01 falkorotter

https://github.com/samchon/nestia/blob/master/packages/core/src/decorators/TypedRoute.ts#L126

Well, can you provide a reproducible repo?

As you can see the nestia code, if text/plain content type comes, it is a critical bug of basic NestJS library (interceptor).

samchon avatar Jan 24 '24 02:01 samchon

https://github.com/samchon/nestia/blob/master/packages/core/src/decorators/TypedRoute.ts#L126

Well, can you provide a reproducible repo?

As you can see the nestia code, if text/plain content type comes, it is a critical bug of basic NestJS library (interceptor).

I encountered the same behavior with Caching. Here reproducible repo: itzRolf/nestia-textplain

itzRolf avatar Mar 22 '24 12:03 itzRolf