Skip to content

Commit

Permalink
Fix tests to compile and run against HttpClient 4.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-adam committed Jun 3, 2023
1 parent 2d1c683 commit 3499a3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- works with v5.2.1; see .github/workflows/maven.yml -->
<httpclient.version>5.2.1</httpclient.version>
<!-- works with v4.3 and forward; see .github/workflows/maven.yml -->
<httpclient.version>[4.5.13,5.0)</httpclient.version>
<!-- the last version to provide LocalTestServer.java -->
<httpclient.test.version>4.3.6</httpclient.test.version>
<httpclient5.version>5.2.1</httpclient5.version>
</properties>

<!-- To check for new plugins and dependencies:
Expand All @@ -65,7 +66,7 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>${httpclient.version}</version>
<version>${httpclient5.version}</version>
</dependency>

<dependency>
Expand All @@ -75,6 +76,13 @@
<scope>test</scope>
</dependency>

<!-- Used by tests... not sure why dependency below is insufficient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static class ModifyHeadersProxyServlet extends ProxyServlet {
public static final String RESPONSE_HEADER = "RESPONSE_HEADER";

@Override
protected void copyRequestHeader(HttpServletRequest servletRequest, HttpRequest proxyRequest, String headerName) {
protected void copyRequestHeader(HttpServletRequest servletRequest, org.apache.hc.core5.http.HttpRequest proxyRequest, String headerName) {
if (REQUEST_HEADER.equalsIgnoreCase(headerName)) {
proxyRequest.addHeader(headerName, "REQUEST_VALUE_MODIFIED");
} else {
Expand All @@ -90,7 +90,7 @@ protected void copyRequestHeader(HttpServletRequest servletRequest, HttpRequest

@Override
protected void copyResponseHeader(HttpServletRequest servletRequest,
HttpServletResponse servletResponse, Header header) {
HttpServletResponse servletResponse, org.apache.hc.core5.http.Header header) {
if (RESPONSE_HEADER.equalsIgnoreCase(header.getName())) {
servletResponse.addHeader(header.getName(), "RESPONSE_VALUE_MODIFIED");
} else {
Expand Down

0 comments on commit 3499a3d

Please sign in to comment.