Removed dependency on 'org.apache.commons.httpclient' (#1436)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
pull/1433/head
Christoph Weitkamp 2020-04-20 22:31:46 +02:00 committed by GitHub
parent a247a021e1
commit e17046ea3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 21 deletions

View File

@ -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>

View File

@ -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>

View File

@ -28,10 +28,10 @@ import javax.servlet.http.HttpServletRequest;
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;
@ -232,7 +232,7 @@ public class AuthorizePageServlet extends HttpServlet {
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;
@ -247,7 +247,7 @@ public class AuthorizePageServlet extends HttpServlet {
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());