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

List somewhere that EncodeDecode middleware needs to be added in the last position after any other middleware. #175

Open
duarteoctavio opened this issue Jun 9, 2021 · 1 comment
Labels

Comments

@duarteoctavio
Copy link

Situation

Perhaps I'm getting something wrong, but after I added CORS middleware to my app, it started getting raw data instead of the type indicadted in the header, until I added the EncodeDecode middleware to the list, with the empty (default) parameters. Then, it worked.

Example

app = RestRserve::Application$new(
                                content_type="application/json",
                                middleware = list(
                                  CORSMiddleware$new(),
                                  EncodeDecodeMiddleware$new()
                                ),
                              )

Congratulations for coding this a amazing app!

@dselivanov
Copy link
Collaborator

Yes, default contsructor initialize EncodeDecodeMiddleware middleware. So when adding more than one you need to list all of them explicitly. May be we need to clarify this in docs.

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

No branches or pull requests

3 participants