Skip to content

Commit

Permalink
Fixes #131 - Add API version check (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Dec 18, 2023
1 parent 0655696 commit cfde865
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.manorrock.toyger.webapp;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;

/**
* The API version checkout.
*
* @see https://distribution.github.io/distribution/spec/api/#api-version-check
* @author MAnfred Riem ([email protected])
*/
@Path("v2")
public class ApiVersionCheckResource {

/**
* Return status 200 with header
* 'Docker-Distribution-API-Version: registry/2.0'.
*
* @return the response.
*/
@GET
public Response apiVersionCheck() {
return Response
.ok()
.header("Docker-Distribution-API-Version", "registry/2.0")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Configures Jakarta RESTful Web Services for the application.
* @author Juneau
*/
@ApplicationPath("resources")
@ApplicationPath("")
public class JakartaRestConfiguration extends Application {

}

0 comments on commit cfde865

Please sign in to comment.