aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ru/sape/SapePageLinks.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ru/sape/SapePageLinks.java')
-rw-r--r--src/main/java/ru/sape/SapePageLinks.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/ru/sape/SapePageLinks.java b/src/main/java/ru/sape/SapePageLinks.java
index e89b4e71..77715aea 100644
--- a/src/main/java/ru/sape/SapePageLinks.java
+++ b/src/main/java/ru/sape/SapePageLinks.java
@@ -1,17 +1,18 @@
package ru.sape;
+import org.apache.commons.lang3.StringUtils;
+
+import java.net.URI;
import java.util.*;
public class SapePageLinks {
private boolean showCode;
- public SapePageLinks(SapeConnection sapeConnection, String sapeUser, String requestUri, String sapeCookie) {
- this(sapeConnection, sapeUser, requestUri, sapeCookie, false);
- }
-
@SuppressWarnings("unchecked")
- public SapePageLinks(SapeConnection sapeConnection, String sapeUser, String requestUri, String sapeCookie, boolean showCode) {
+ public SapePageLinks(SapeConnection sapeConnection, String sapeUser, URI request, String sapeCookie, boolean showCode) {
+ String req = StringUtils.isNotEmpty(request.getQuery()) ? request.getPath() + "?" + request.getQuery()
+ : request.getPath();
if (sapeUser.equals(sapeCookie)) {
showCode = true;
}
@@ -22,8 +23,8 @@ public class SapePageLinks {
linkDelimiter = (String) data.get("__sape_delimiter__");
}
- if (data.containsKey(requestUri)) {
- pageLinks = new ArrayList<>(((Map<Object, String>) data.get(requestUri)).values());
+ if (data.containsKey(req)) {
+ pageLinks = new ArrayList<>(((Map<Object, String>) data.get(req)).values());
}
if (data.containsKey("__sape_new_url__")) {