Removed dependency on 'org.apache.commons.httpclient' (#1436)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>pull/1433/head
parent
a247a021e1
commit
e17046ea3f
|
@ -58,12 +58,6 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Apache Commons -->
|
<!-- 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>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
|
|
@ -348,18 +348,6 @@
|
||||||
<!-- END: logging -->
|
<!-- END: logging -->
|
||||||
|
|
||||||
<!-- Apache Commons -->
|
<!-- 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>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
|
|
@ -28,10 +28,10 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.ws.rs.core.HttpHeaders;
|
import javax.ws.rs.core.HttpHeaders;
|
||||||
|
|
||||||
import org.apache.commons.httpclient.HttpStatus;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
import org.openhab.core.auth.Authentication;
|
import org.openhab.core.auth.Authentication;
|
||||||
import org.openhab.core.auth.AuthenticationException;
|
import org.openhab.core.auth.AuthenticationException;
|
||||||
import org.openhab.core.auth.AuthenticationProvider;
|
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;
|
String state = params.containsKey("state") ? params.get("state")[0] : null;
|
||||||
resp.addHeader(HttpHeaders.LOCATION, getRedirectUri(baseRedirectUri, authorizationCode, null, state));
|
resp.addHeader(HttpHeaders.LOCATION, getRedirectUri(baseRedirectUri, authorizationCode, null, state));
|
||||||
resp.setStatus(HttpStatus.SC_MOVED_TEMPORARILY);
|
resp.setStatus(HttpStatus.MOVED_TEMPORARILY_302);
|
||||||
} catch (AuthenticationException e) {
|
} catch (AuthenticationException e) {
|
||||||
lastAuthenticationFailure = Instant.now();
|
lastAuthenticationFailure = Instant.now();
|
||||||
authenticationFailureCount += 1;
|
authenticationFailureCount += 1;
|
||||||
|
@ -247,7 +247,7 @@ public class AuthorizePageServlet extends HttpServlet {
|
||||||
String state = params.containsKey("state") ? params.get("state")[0] : null;
|
String state = params.containsKey("state") ? params.get("state")[0] : null;
|
||||||
if (baseRedirectUri != null) {
|
if (baseRedirectUri != null) {
|
||||||
resp.addHeader(HttpHeaders.LOCATION, getRedirectUri(baseRedirectUri, null, e.getMessage(), state));
|
resp.addHeader(HttpHeaders.LOCATION, getRedirectUri(baseRedirectUri, null, e.getMessage(), state));
|
||||||
resp.setStatus(HttpStatus.SC_MOVED_TEMPORARILY);
|
resp.setStatus(HttpStatus.MOVED_TEMPORARILY_302);
|
||||||
} else {
|
} else {
|
||||||
resp.setContentType("text/plain;charset=UTF-8");
|
resp.setContentType("text/plain;charset=UTF-8");
|
||||||
resp.getWriter().append(e.getMessage());
|
resp.getWriter().append(e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue