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

Juzu 1.0-beta3 - GET call on existing @Route configured only for POST should raise an exception #69

Open
fdrouet opened this issue May 9, 2014 · 1 comment

Comments

@fdrouet
Copy link
Contributor

fdrouet commented May 9, 2014

The problem

Calling the following controller method (http://localhost:8080/rest/app) :

  @Route("rest/app-save")
  @Resource(method = HttpMethod.POST)
  @MimeType.JSON
  @Jackson
  public Software saveApp(@Jackson Software software) {
    ...
    return software;
  }

with a GET http request don't raise any error and send a redirect (with a 302) to http://localhost:8080/

What I expect

If we call an existing route with an unconfigured HttpMethod, we should raise an error which explain the error. If we don't raise an error, we could silently call the bad endpoint and it could lead to nasty bug which could be very difficult to detect.

How-to reproduce

My environment

  • java 1.7.0_51
  • Tomcat 7.0.37
  • juzu 1.0.0-beta3
@vietj
Copy link
Contributor

vietj commented May 12, 2014

The current behaviour of Juzu is expected: when a request cannot be routed then the http bridge will set a 404 response code.

What you are observing here is an edge case of the "index" controller handler that catches any GET request that is not routed.

If you want to change this behaviour you need to remove the "index" handler of the MyApplication controller.

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

2 participants