mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
fix issues with homepages...
This commit is contained in:
parent
10fa501863
commit
2d5363eade
@ -105,14 +105,17 @@ public class ProjectPageService extends HangarComponent {
|
||||
}
|
||||
|
||||
public ExtendedProjectPage getProjectPage(String author, String slug, String requestUri) {
|
||||
String path = requestUri.replace("/api/internal/pages/page/" + author + "/" + slug + "/", "");
|
||||
String path = requestUri.replace("/api/internal/pages/page/" + author + "/" + slug, "");
|
||||
ExtendedProjectPage pageTable;
|
||||
if (path.equals("/")) {
|
||||
if (path.equals("") || path.equals("/")) {
|
||||
pageTable = hangarProjectPagesDAO.getHomePage(author, slug);
|
||||
} else {
|
||||
if (path.endsWith("/")) {
|
||||
path = path.substring(0, path.length() - 1);
|
||||
}
|
||||
if (path.startsWith("/")) {
|
||||
path = path.substring(1);
|
||||
}
|
||||
pageTable = hangarProjectPagesDAO.getProjectPage(author, slug, path);
|
||||
}
|
||||
if (pageTable == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user