From e684d4388b28ed791fc5e31d59bab263c11f0fdc Mon Sep 17 00:00:00 2001 From: Joshua Bauer Date: Thu, 13 Feb 2020 16:28:13 -0800 Subject: [PATCH] Cleanup poms and improve redirect. --- CHANGELOG.md | 5 + pom.xml | 279 ++++++++++++------ .../proteus/server/ServerRequest.java | 1 + 3 files changed, 193 insertions(+), 92 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17bdb7d..cf76069 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Proteus Changelog. ## Unreleased ### No issue +**Redirect improvements.** + + +[7fc1a12a7508952](https://github.com/noboomu/proteus/commit/7fc1a12a7508952) Joshua Bauer *2020-02-13 23:36:16* + **Added redirect mechanism on ServerRequest.** diff --git a/pom.xml b/pom.xml index 0725272..b94e78f 100644 --- a/pom.xml +++ b/pom.xml @@ -164,109 +164,32 @@ - sonatype-nexus-snapshots + ossrh https://oss.sonatype.org/content/repositories/snapshots - sonatype-nexus-staging + ossrh https://oss.sonatype.org/service/local/staging/deploy/maven2/ - + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + false + + + - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - org.apache.maven.surefire - surefire-junit47 - ${maven-surefire-plugin.version} - - - - -Dconfig.file=src/test/resources/application.conf - -Dlogback.configuration=src/test/resources/logback-test.xml - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - 8 - - ${maven-javadoc-plugin.version} - - - attach-javadocs - - jar - - - none - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.apache.maven.plugins maven-compiler-plugin @@ -312,6 +235,7 @@ + maven-surefire-plugin ${maven-surefire-plugin.version} @@ -328,6 +252,57 @@ + + + org.apache.maven.plugins + maven-javadoc-plugin + + 8 + + ${maven-javadoc-plugin.version} + + + attach-javadocs + + jar + + + none + + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + + gpg + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging-maven-plugin.version} + true + + ossrh + https://oss.sonatype.org/ + true + + + org.apache.maven.plugins maven-release-plugin @@ -347,6 +322,126 @@ + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + 8 + + ${maven-javadoc-plugin.version} + + + attach-javadocs + + jar + + + none + + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + + gpg + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging-plugin.version} + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-release-plugin + ${maven-release-plugin.version} + + true + v@{project.version} + ossrh + deploy + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + -parameters + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-versions + + enforce + + + + + 1.8 + + + + + + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + org.apache.maven.surefire + surefire-junit47 + ${maven-surefire-plugin.version} + + + + -Dconfig.file=src/test/resources/application.conf + -Dlogback.configuration=src/test/resources/logback-test.xml + + @@ -425,7 +520,7 @@ ${nexus-staging-maven-plugin.version} true - sonatype-nexus-stagin + ossrh https://oss.sonatype.org/ true diff --git a/proteus-core/src/main/java/io/sinistral/proteus/server/ServerRequest.java b/proteus-core/src/main/java/io/sinistral/proteus/server/ServerRequest.java index 4114ea7..30ef312 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/server/ServerRequest.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/server/ServerRequest.java @@ -190,6 +190,7 @@ public void startAsync(final Executor executor, final Runnable runnable) public ServerResponse redirect(String location, boolean includeParameters) { + exchange.setRelativePath("/"); exchange.getResponseHeaders().put(Headers.LOCATION, RedirectBuilder.redirect(exchange, location, includeParameters)); exchange.setStatusCode(302); exchange.endExchange();