fix checkout of repositories with dots in the names

This commit is contained in:
Sebastian Sdorra
2019-07-22 13:00:49 +02:00
parent 4a275c445e
commit 56a683c7c5
3 changed files with 84 additions and 16 deletions

View File

@@ -32,13 +32,15 @@ public class HttpProtocolServlet extends HttpServlet {
public static final String PATTERN = PATH + "/*";
private final RepositoryServiceFactory serviceFactory;
private final NamespaceAndNameFromPathExtractor pathExtractor;
private final PushStateDispatcher dispatcher;
private final UserAgentParser userAgentParser;
@Inject
public HttpProtocolServlet(RepositoryServiceFactory serviceFactory, PushStateDispatcher dispatcher, UserAgentParser userAgentParser) {
public HttpProtocolServlet(RepositoryServiceFactory serviceFactory, NamespaceAndNameFromPathExtractor pathExtractor, PushStateDispatcher dispatcher, UserAgentParser userAgentParser) {
this.serviceFactory = serviceFactory;
this.pathExtractor = pathExtractor;
this.dispatcher = dispatcher;
this.userAgentParser = userAgentParser;
}
@@ -51,7 +53,7 @@ public class HttpProtocolServlet extends HttpServlet {
dispatcher.dispatch(request, response, request.getRequestURI());
} else {
String pathInfo = request.getPathInfo();
Optional<NamespaceAndName> namespaceAndName = NamespaceAndNameFromPathExtractor.fromUri(pathInfo);
Optional<NamespaceAndName> namespaceAndName = pathExtractor.fromUri(pathInfo);
if (namespaceAndName.isPresent()) {
service(request, response, namespaceAndName.get());
} else {