Skip to content

Commit 360a03c

Browse files
committed
Fixed #1674: duplicated route prefix in profiler urls
1 parent b43e9b1 commit 360a03c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/profiler/utils/ProfilerUtil.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static Collection<ProfilerRequestInterface> createRequestsFromIndexHtml(@
128128
if(tokenLink != null) {
129129
String href = tokenLink.getAttributeValue("href");
130130
if(StringUtils.isNotBlank(href)) {
131-
profilerUrl = StringUtils.stripEnd(baseUrl, "/") + href;
131+
profilerUrl = getProfilerAbsoluteUrl(baseUrl, href);
132132
}
133133
}
134134

@@ -153,6 +153,11 @@ public static Collection<ProfilerRequestInterface> createRequestsFromIndexHtml(@
153153
return requests;
154154
}
155155

156+
@NotNull
157+
private static String getProfilerAbsoluteUrl(@NotNull String baseUrl, @NotNull String href) {
158+
return StringUtils.stripEnd(baseUrl, "/") + href.substring(href.indexOf("/_profiler/"));
159+
}
160+
156161
@NotNull
157162
public static Collection<ProfilerRequestInterface> collectHttpDataForRequest(@NotNull Project project, @NotNull Collection<ProfilerRequestInterface> requests) {
158163
Collection<Callable<ProfilerRequestInterface>> callable = requests.stream().map(

0 commit comments

Comments
 (0)