Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Add cookie support #54

Merged
merged 3 commits into from
Mar 30, 2017
Merged

Conversation

spacepants
Copy link
Contributor

Hey there,

This adds support for setting cookies in the HTTP request for the download.

For example, you can download the Java JDK installer from Oracle like so:

  download_file { 'Download JDK' :
    url                   => 'http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-windows-x64.exe',
    destination_directory => 'c:\temp',
    cookies               => ['oraclelicense=accept-securebackup-cookie', 'gpw_e24=http://edelivery.oracle.com'],
  }

Copy link
Member

@alexjfisher alexjfisher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than whether you should be using data types or not, this LGTM. Thanks!

@@ -77,6 +81,11 @@
Exec { timeout => $timeout }
}

if $cookies {
validate_array($cookies)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module has had its last puppet 3 release. This means you can use puppet 4 data types instead of validate functions and I think this is preferred.

@alexjfisher alexjfisher merged commit e6cacaa into voxpupuli:master Mar 30, 2017
@alexjfisher
Copy link
Member

@spacepants Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants