Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
falkorotter opened this issue Jan 23, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@falkorotter
Copy link

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?

@samchon samchon self-assigned this Jan 24, 2024
@samchon samchon added the enhancement New feature or request label Jan 24, 2024
@samchon
Copy link
Owner

samchon commented Jan 24, 2024

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 samchon added question Further information is requested and removed enhancement New feature or request labels Jan 24, 2024
@itzRolf
Copy link

itzRolf commented Mar 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants