Skip to content

Commit

Permalink
Removed dependency on 'org.apache.commons.httpclient' (openhab#1436)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
  • Loading branch information
cweitkamp committed Apr 20, 2020
1 parent a247a02 commit e17046e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
6 changes: 0 additions & 6 deletions bom/compile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
</dependency>

<!-- Apache Commons -->
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId>
<version>3.1_7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
12 changes: 0 additions & 12 deletions bom/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,6 @@
<!-- END: logging -->

<!-- Apache Commons -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId>
<version>3.1_7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.HttpHeaders;

import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.io.IOUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.http.HttpStatus;
import org.openhab.core.auth.Authentication;
import org.openhab.core.auth.AuthenticationException;
import org.openhab.core.auth.AuthenticationProvider;
Expand Down Expand Up @@ -232,7 +232,7 @@ protected void doPost(@Nullable HttpServletRequest req, @Nullable HttpServletRes

String state = params.containsKey("state") ? params.get("state")[0] : null;
resp.addHeader(HttpHeaders.LOCATION, getRedirectUri(baseRedirectUri, authorizationCode, null, state));
resp.setStatus(HttpStatus.SC_MOVED_TEMPORARILY);
resp.setStatus(HttpStatus.MOVED_TEMPORARILY_302);
} catch (AuthenticationException e) {
lastAuthenticationFailure = Instant.now();
authenticationFailureCount += 1;
Expand All @@ -247,7 +247,7 @@ protected void doPost(@Nullable HttpServletRequest req, @Nullable HttpServletRes
String state = params.containsKey("state") ? params.get("state")[0] : null;
if (baseRedirectUri != null) {
resp.addHeader(HttpHeaders.LOCATION, getRedirectUri(baseRedirectUri, null, e.getMessage(), state));
resp.setStatus(HttpStatus.SC_MOVED_TEMPORARILY);
resp.setStatus(HttpStatus.MOVED_TEMPORARILY_302);
} else {
resp.setContentType("text/plain;charset=UTF-8");
resp.getWriter().append(e.getMessage());
Expand Down

0 comments on commit e17046e

Please sign in to comment.