mojohaus/license-maven-plugin

Downloading Licenses gives Cookie Header Warning

astropcrb opened this issue · 9 comments

I am getting a warning such as:

WARNING: Invalid cookie header: "Set-Cookie: _octo=GH1.1.752364444.1618627082; Path=/; Domain=github.com; Expires=Sun, 17 Apr 2022 02:38:02 GMT; Secure; SameSite=Lax". Invalid 'expires' attribute: Sun, 17 Apr 2022 02:38:02 GMT
Apr 16, 2021 10:38:02 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies

when using the "download-licenses" goal. A quick StackOverflow search turns up an easy solution.
HttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfig(RequestConfig.custom() .setCookieSpec(CookieSpecs.STANDARD).build()).build();

Need to update the creation of the HttpClient to set the Cookie Spec. See StackOverflow here: https://stackoverflow.com/questions/36473478/fixing-httpclient-warning-invalid-expires-attribute-using-fluent-api/40697322

Line in question:

HttpClientBuilder clientBuilder = HttpClients.custom().setDefaultRequestConfig( configBuilder.build() );

Hey guys,

Can this be progressed as this is a simple fix.

This is a simple fix. Just add .setCookieSpec(CookieSpecs.STANDARD). Would any of you two want to contribute this as a fix via a PR?

This is a simple fix. Just add .setCookieSpec(CookieSpecs.STANDARD). Would any of you two want to contribute this as a fix via a PR?

I tried but my Devops java skills are poor. :)) Need some help from an Java Yoda master. :)

Hey @andrei-bamboi,

You almost did it right! :)
I suggest you create a branch from the current master (not yours) and apply the change there.
Then you can just click "compare and create a PR" on github.

That's it!

Hey @andrei-bamboi,

You almost did it right! :)
I suggest you create a branch from the current master (not yours) and apply the change there.
Then you can just click "compare and create a PR" on github.

That's it!

Nice. Ok. Thanks mate.

Hey @andrei-bamboi,

You almost did it right! :)
I suggest you create a branch from the current master (not yours) and apply the change there.
Then you can just click "compare and create a PR" on github.

That's it!

I cant create branches. I will create one in my forked repo

Hey @andrei-bamboi,

You almost did it right! :)
I suggest you create a branch from the current master (not yours) and apply the change there.
Then you can just click "compare and create a PR" on github.

That's it!

#408

hey guys any progress with this one ? I am getting the same issue as well

Fixed by #472