Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix incorrect use of .join() with newlines #1425

Merged
merged 1 commit into from
Apr 13, 2016

Conversation

mpeter
Copy link
Contributor

@mpeter mpeter commented Apr 13, 2016

Assuming a puppet file with the following from ::apache::mod::pagespeed

additional_configuration      => [
    "ModPagespeedEnableCachePurge $mod_pagespeed_enable_cache_purge",
    "ModPagespeedAnalyticsID $analytics_id",
    'ModPagespeedDisallow */APOS/*',
    'ModPagespeedDisallow */jasperserver-pro/*',
],  

this is evaluated:

<% if @additional_configuration.is_a? Array -%>
<%= @additional_configuration.join('\n') %>
<% else -%>

resulting in this...

ModPagespeedEnableCachePurge On\nModPagespeedAnalyticsID UA-xxxx-1\nModPagespeedDisallow */APOS/*\nModPagespeedDisallow */jasperserver-pro/*

Using double quotes for the .join("\n") makes it work correctly:

ModPagespeedEnableCachePurge On
ModPagespeedAnalyticsID UA-xxxx-1
ModPagespeedDisallow */APOS/*
ModPagespeedDisallow */jasperserver-pro/*

@tphoney
Copy link
Contributor

tphoney commented Apr 13, 2016

Great catch !!!. Thanks for the PR @mpeter

@tphoney tphoney merged commit ccd49ca into puppetlabs:master Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants