license-maven-plugin icon indicating copy to clipboard operation
license-maven-plugin copied to clipboard

Downloading Licenses gives Cookie Header Warning

Open astropcrb opened this issue 3 years ago • 7 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: https://github.com/mojohaus/license-maven-plugin/blob/01fd9a1c560fb608e721de0cb1673a29805a40cd/src/main/java/org/codehaus/mojo/license/download/LicenseDownloader.java#L107

astropcrb avatar Apr 17 '21 02:04 astropcrb

Hey guys,

Can this be progressed as this is a simple fix.

andrei-bamboi avatar Jul 09 '21 09:07 andrei-bamboi

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?

bmarwell avatar Jul 12 '21 06:07 bmarwell

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. :)

andrei-bamboi avatar Jul 12 '21 08:07 andrei-bamboi

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!

bmarwell avatar Jul 12 '21 08:07 bmarwell

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.

andrei-bamboi avatar Jul 12 '21 08:07 andrei-bamboi

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

andrei-bamboi avatar Jul 12 '21 09:07 andrei-bamboi

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!

https://github.com/mojohaus/license-maven-plugin/pull/408

andrei-bamboi avatar Jul 12 '21 10:07 andrei-bamboi

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

danHayworth avatar May 08 '23 05:05 danHayworth

Fixed by #472

slawekjaranowski avatar Jun 06 '23 10:06 slawekjaranowski