diff --git a/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupApiController.java b/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupApiController.java index 7be8d60f7..d8c8f6c2b 100644 --- a/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupApiController.java +++ b/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupApiController.java @@ -62,13 +62,13 @@ public Context handleContext(Context ctx) { ReposiliteContext context = contextFactory.create(ctx); Reposilite.getLogger().info("API " + context.uri() + " from " + context.address()); - String uri = ReposiliteUtils.normalizeUri(rewritePathsEnabled, repositoryService, StringUtils.replaceFirst(ctx.req.getRequestURI(), "/api", "")); + String uri = ReposiliteUtils.normalizeUri(rewritePathsEnabled, repositoryService, StringUtils.replaceFirst(context.uri(), "/api", "")); if (StringUtils.isEmpty(uri) || "/".equals(uri)) { - return ctx.json(lookupService.findAvailableRepositories(ctx.headerMap())); + return ctx.json(lookupService.findAvailableRepositories(context.headers())); } - Result, ErrorDto> result = repositoryAuthenticator.authRepository(ctx.headerMap(), ctx.req.getRequestURI(), uri); + Result, ErrorDto> result = repositoryAuthenticator.authRepository(context.headers(), uri); if (result.containsError()) { return ResponseUtils.errorResponse(ctx, result.getError().getStatus(), result.getError().getMessage()); diff --git a/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/RepositoryAuthenticator.java b/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/RepositoryAuthenticator.java index dc6ca0fb1..94987e82b 100644 --- a/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/RepositoryAuthenticator.java +++ b/reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/RepositoryAuthenticator.java @@ -41,10 +41,10 @@ public RepositoryAuthenticator(boolean rewritePathsEnabled, Authenticator authen } public Result, ErrorDto> authDefaultRepository(Map headers, String uri) { - return authRepository(headers, uri, ReposiliteUtils.normalizeUri(rewritePathsEnabled, repositoryService, uri)); + return authRepository(headers, ReposiliteUtils.normalizeUri(rewritePathsEnabled, repositoryService, uri)); } - public Result, ErrorDto> authRepository(Map headers, String uri, String normalizedUri) { + public Result, ErrorDto> authRepository(Map headers, String normalizedUri) { String[] path = StringUtils.split(normalizedUri, "/"); String repositoryName = path[0]; @@ -60,7 +60,7 @@ public Result, ErrorDto> authRepository(Map