You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by "kinow (via GitHub)" <gi...@apache.org> on 2023/01/25 09:50:58 UTC

[GitHub] [jena] kinow commented on a diff in pull request #1729: GH-1723: Allow for overriding the default dispatch choice

kinow commented on code in PR #1729:
URL: https://github.com/apache/jena/pull/1729#discussion_r1086418186


##########
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/Dispatcher.java:
##########
@@ -395,27 +455,13 @@ private static void applyAuthentication(String user, DataService dataService, En
      * Assumes, and does not check, that the action is a GSP action.
      */
     private static Operation gspOperation(HttpAction action, HttpServletRequest request) {
-        // Check enabled.
-        if ( isReadMethod(request) )
-            return GSP_R;
-        else
-            return GSP_RW;
+        return isReadMethod(request) ? GSP_R : GSP_RW;
     }
 
     /**
-     * Determine the {@link Operation} for a Quads operation. (GSP, except on the
-     * whole dataset).
-     * <p>
-     * Assumes, and does not check, that the action is a Quads action.
+     * Return whether request method is a "read" (GET or HEAD) or "write", modifying
+     * (POST, PUT, DELETE, PATCH)

Review Comment:
   Yeah, I think for CORS some JS libraries did an `OPTIONS` request before. Not sure if/how that would work here, but worth considering that too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org