resolve entry link when url is relative (fix #181)

This commit is contained in:
Athou
2013-05-26 07:28:32 +02:00
parent 122acfcf70
commit f04b24796c
5 changed files with 32 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
import com.commafeed.backend.StartupBean;
import com.commafeed.backend.dao.UserDAO;
import com.commafeed.backend.feeds.FeedUtils;
import com.commafeed.backend.feeds.OPMLImporter;
import com.commafeed.backend.model.ApplicationSettings;
import com.commafeed.backend.model.User;
@@ -44,10 +45,7 @@ public class GoogleImportCallbackPage extends WebPage {
UserDAO userDAO;
public static String getCallbackUrl(String publicUrl) {
if (publicUrl.endsWith("/")) {
publicUrl = publicUrl.substring(0, publicUrl.length() - 1);
}
return publicUrl + "/" + PAGE_PATH;
return FeedUtils.removeTrailingSlash(publicUrl) + "/" + PAGE_PATH;
}
public GoogleImportCallbackPage(PageParameters params) {

View File

@@ -14,6 +14,7 @@ import org.apache.wicket.model.Model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.commafeed.backend.feeds.FeedUtils;
import com.commafeed.backend.model.User;
import com.commafeed.frontend.pages.components.BootstrapFeedbackPanel;
@@ -67,10 +68,9 @@ public class PasswordRecoveryPage extends BasePage {
private String buildEmailContent(User user) throws Exception {
String publicUrl = applicationSettingsService.get().getPublicUrl();
if (publicUrl.endsWith("/")) {
publicUrl = publicUrl.substring(0, publicUrl.length() - 1);
}
String publicUrl = FeedUtils
.removeTrailingSlash(applicationSettingsService.get()
.getPublicUrl());
publicUrl += "/recover2";
return String