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

NotFound returns 200 instead of 404 #554

Closed
orlandojsjr opened this issue Nov 3, 2015 · 2 comments
Closed

NotFound returns 200 instead of 404 #554

orlandojsjr opened this issue Nov 3, 2015 · 2 comments

Comments

@orlandojsjr
Copy link

I'm using org.scalatra.NotFound as result of an action.
With parameter:

NotFound("some value") returns 404

Without parameter:

NotFound returns 200

Is it correct?

issue-related: #390

@seratch seratch added this to the 2.5.0 milestone Nov 25, 2015
@orlandojsjr orlandojsjr changed the title NotFound() returns 200 instead of 404 NotFound returns 200 instead of 404 Jan 12, 2016
@verto
Copy link

verto commented Jan 12, 2016

The problem is that you didn't call NotFound with (), it's important to execute the apply of NotFound object where it return an ActionResult instance. see it: https://github.com/scalatra/scalatra/blob/2.4.x/core/src/main/scala/org/scalatra/ActionResult.scala#L132-L134

So, when you just write "NotFound", the action return value is an object where it's rendered like a simple string value.

@takezoe takezoe removed this from the 2.5.0 milestone Mar 3, 2017
@takezoe
Copy link
Member

takezoe commented Mar 3, 2017

Close because this is not a bug of Scalatra.

@takezoe takezoe closed this as completed Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants