HttpClient RequestConfig cannot be set
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- networking
Research direction
Start at the ApacheHttpRequest constructor and trace how each request's RequestConfig is created, then compare that with the default configuration set on the HttpClient builder. The work is done when a baseline RequestConfig supplied through the builder can influence requests, including the CookieSpecs.STANDARD setting described in the issue.
Written by the indexing model from the issue text.
Description
AWS ALB sticky sessions use a cookie format that is not compatible with the default Apache HttpClient cookie specification.
The remedy for this is to provide a RequestConfig with CookieSpec set to CookieSpecs.STANDARD. But, there appears to be no way for such a RequestConfig to be actually used in this library.
Currently, I use the following mechanism attempting to provide a RequestConfig:
var builder = ApacheHttpTransport
.newDefaultHttpClientBuilder()
.setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD).build());
HTTP_TRANSPORT = new ApacheHttpTransport(builder.build());
...
RequestFactoryPlain = HTTP_TRANSPORT.createRequestFactory();
...
HttpRequest request = RequestFactoryPlain.buildRequest(method, url, content);
This RequestConfig is however not used, as the ApacheHttpRequest constructor creates a custom request configuration for every request, preventing the HttpClient default request config from being used.
Is there a different mechanism that would allow me to provide a baseline RequestConfig? If not, can one be added - potentially by using the provided HttpClient RequestConfig as a baseline instead of ignoring it and overwriting the values in ApacheHttpRequest ctor?
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 476
- Avg merge
- 10h 47m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/google-http-java-client
-
Core: Validate header names and values to prevent CRLF injectionPossibly taken @insaf021 claimed this 106 days ago. Openpriority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Core: XmlPullParser processes external DTD entities (XXE) — disable FEATURE_PROCESS_DOCDECL in Xml#createParser()Possibly taken @insaf021 claimed this 106 days ago. Openpriority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Core: LowLevelHttpResponse not disconnected when HttpResponse construction throws RuntimeExceptionPossibly taken @insaf021 claimed this 106 days ago. Openpriority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
type: cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
org.apache.http.conn.ssl.SSLSocketFactory is deprecatedMay be free again A pull request for this issue was closed without being merged. Openpriority: p2 type: cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
All issues in googleapis/google-http-java-client
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 Under an hour Newbie friendliness 84/100
cpp-best-practices/project_validator#251 ·
Maintainers usually reply within 1 day
-
backend enhancement
Difficulty 2/5 Half a day Newbie friendliness 70/100
damodharg6/payledger#16 ·
-
[Bug]: An initiative list with no current entry logs an error on every changePossibly taken @dwizard0 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day