Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.primeframework</groupId>
<artifactId>prime-mvc</artifactId>
<version>5.1.1</version>
<version>5.2.0</version>
<packaging>jar</packaging>

<name>FusionAuth App</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2024, Inversoft Inc., All Rights Reserved
* Copyright (c) 2001-2025, Inversoft Inc., All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,7 @@
import io.fusionauth.http.server.HTTPRequest;
import io.fusionauth.http.server.HTTPResponse;
import org.primeframework.mvc.NotAllowedException;
import org.primeframework.mvc.NotImplementedException;
import org.primeframework.mvc.http.HTTPTools;
import org.primeframework.mvc.http.Status;
import org.primeframework.mvc.parameter.fileupload.annotation.FileUpload;
Expand Down Expand Up @@ -93,7 +94,15 @@ public void perform(WorkflowChain chain) throws IOException {
if (actionInvocation.action != null && actionInvocation.method == null) {
Class<?> actionClass = actionInvocation.configuration.actionClass;
logger.debug("The action class [{}] does not have a valid execute method for the HTTP method [{}]", actionClass.getCanonicalName(), method);
throw new NotAllowedException();

// Differentiate between not allowed for this action, vs not-implemented (supported by prime-mvc).
if (HTTPMethod.StandardMethods.containsKey(method.name())) {
throw new NotAllowedException();
}

// Note that the DefaultActionConfigurationBuilder will only resolve executeMethods for methods named in StandardMethods.
// See HTTPMethod.StandardMethods and DefaultActionConfigurationBuilder.findExecuteMethods
throw new NotImplementedException();
}

// Handle multipart file configuration
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/org/primeframework/mvc/GlobalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,11 @@ public void notAllowed() {
public void notImplemented() {
simulator.test("/not-allowed")
.method("POTATO")
.assertStatusCode(405) // Not allowed since we can handle any name but the action doesn't have that method
// We currently only map out execute methods in the action that are named by a method
// defined in the HTTPMethod.StandardMethods. If an action does not define a standard HTTP
// method, a 405 will be returned. If you ask for a non-standard method that is not implemented
// by prime-mvc, you will receive a 501.
.assertStatusCode(501)
.assertHeaderContains("Cache-Control", "no-cache");
}

Expand Down