@@ -89,16 +89,22 @@ public String uriList(@PathVariable("commitid") String commitId,
89
89
MediaType .APPLICATION_JSON_VALUE ,
90
90
MediaType .APPLICATION_JSON_UTF8_VALUE })
91
91
public void goToViewer (@ PathVariable ("commitid" ) String commitId ,
92
+ @ RequestParam (name = "part" ) Optional <String > part ,
93
+ @ RequestParam (name = "format" ) Optional <String > format ,
92
94
HttpServletRequest request ,
93
95
HttpServletResponse response ) {
94
- Workflow workflow = getWorkflow (commitId , request );
95
- response .setHeader ("Location" , workflow .getRetrievedFrom ().getInternalUrl (commitId ));
96
+ String location ;
97
+ Workflow workflow = getWorkflow (commitId , request , part );
98
+ location = workflow .getRetrievedFrom ().getInternalUrl (commitId ) + format .map (f -> "?format=" + f ).orElse ("" );
99
+ response .setHeader ("Location" , location );
96
100
response .setStatus (HttpServletResponse .SC_MOVED_TEMPORARILY );
97
101
}
98
102
99
103
/**
100
104
* Redirect to the raw file if this exists
101
- * @param commitId The commit ID of the workflow
105
+ *
106
+ * @param commitId
107
+ * The commit ID of the workflow
102
108
* @return A 302 redirect response to the raw URL or 406
103
109
*/
104
110
@ GetMapping (value = "/git/{commitid}/**" ,
0 commit comments