Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions library/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
Expand Down
11 changes: 11 additions & 0 deletions library/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=false
show.console.view=false
show.executions.view=false
2 changes: 1 addition & 1 deletion library/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=3.0.2
version=3.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ public static boolean hasHttpServletRequest() {

private static String cachedBaseUrl;

public static String removeUrlQueryParams(String url) {
int index = url.indexOf('?');
if (index >= 0) {
url = url.substring(0, index);
}
return url;
}

public static String getBaseUrl(HttpServletRequest request) {
String url = request.getRequestURL().toString();
url = removeUrlQueryParams(url);
String baseUrl = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath() + "/";
return baseUrl;
}

public static String getBaseUrl() {
HttpServletRequest request = getThreadLocalHttpServletRequest().get();
if (request == null) {
Expand All @@ -86,8 +101,7 @@ public static String getBaseUrl() {
}
return cachedBaseUrl;
}
String url = request.getRequestURL().toString();
String baseUrl = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath() + "/";
String baseUrl = getBaseUrl(request);
cachedBaseUrl = baseUrl;
return baseUrl;
}
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.11.1'
implementation 'org.jboss.resteasy:resteasy-jackson2-provider:6.2.8.Final'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.7'
implementation 'com.northconcepts:northconcepts-templatemaster:3.0.0'
implementation 'com.northconcepts:northconcepts-templatemaster:3.0.2'
implementation 'org.springframework.data:spring-data-commons:2.1.2.RELEASE'
//compile fileTree(dir: 'lib', include: ['*.jar'])

Expand Down