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

Update mime.conf.erb to support dynamic AddHandler AddType AddOutputF… #1232

Merged
merged 1 commit into from
Nov 3, 2015

Conversation

prabin5
Copy link
Contributor

@prabin5 prabin5 commented Oct 23, 2015

'Forge Modules'
Forge ModulesMODULES-2748
Update mime.conf.erb to support dynamic AddHandler AddType AddOutputFilter

@prabin5 prabin5 force-pushed the dynamic_mime_template branch 2 times, most recently from 04ce559 to 212eaab Compare October 24, 2015 02:45
@prabin5
Copy link
Contributor Author

prabin5 commented Oct 26, 2015

Usage:
Any Additional types can be added to mime.conf by using the hashes. Existing functionality will not be affected but will have ability to add additional ones or change AddHandler AddType AddOutputFilter fields as needed.

mime_types_additional => {
  "AddHandler"      => {"type-map" => "var"}, 
  "AddType"         => {"type-map" => ".shtml"},
  "AddOutputFilter" => {"INCLUDES" => ".shtml"},
}

@prabin5 prabin5 force-pushed the dynamic_mime_template branch 4 times, most recently from d3c5407 to 5e6d69a Compare October 29, 2015 14:41
@@ -487,6 +491,7 @@
$fastcgi_lib_path = '/var/lib/apache2/fastcgi'
$mime_support_package = 'aaa_base'
$mime_types_config = '/etc/mime.types'
$mime_types_additional = {'AddHandler' => {'type-map' => 'var'}, 'AddType' => {'type-map' => '.shtml'},'AddOutputFilter' => {'INCLUDES' => '.shtml'},}
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you putting this in every single branch, instead of just on top?
It's always the same, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhh..yes correct...thanks for catching. fixed and pushed again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated with better hash formatting for readability.

@prabin5 prabin5 force-pushed the dynamic_mime_template branch 2 times, most recently from f7af65a to b6675d6 Compare October 29, 2015 18:02
@prabin5
Copy link
Contributor Author

prabin5 commented Oct 29, 2015

yes correct...thanks for catching. fixed and pushed again. also updated with better hash formatting for readability.

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
<%- @mime_types_additional.sort.each do |key, value_hash| -%>
<%- value_hash.each do |value_hash_key, value_hash_value| %><%=key%> <%=value_hash_key%> <%=value_hash_value%><% end %>
Copy link
Contributor

Choose a reason for hiding this comment

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

this is terrible on the eyes… 👓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmmm...it shows 3 lines in actual file...its strange that the diff is showing it on one line?
do you mean to refactor the second line with extra indenting?
<%- @mime_types_additional.sort.each do |key, value_hash| -%>
<%- value_hash.each do |value_hash_key, value_hash_value| %><%=key%> <%=value_hash_key%> <%=value_hash_value%><% end %>
<% end %>

Copy link
Contributor

Choose a reason for hiding this comment

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

@prabin5 is this some weird mis-match between different line-endings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@igalic ya...i noticed some weird line endings too. Tried to fix in latest commit pushed 393a7fd. please check.

@prabin5 prabin5 force-pushed the dynamic_mime_template branch from b6675d6 to 393a7fd Compare November 2, 2015 15:15
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
<%- @mime_types_additional.sort.each do |key, value_hash| -%>
Copy link
Contributor

Choose a reason for hiding this comment

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

slightly better names: |add_mime, config|

@igalic
Copy link
Contributor

igalic commented Nov 2, 2015

@prabin5 thanks for updating, i hope my comments help

@prabin5 prabin5 force-pushed the dynamic_mime_template branch from 393a7fd to cc3e55a Compare November 2, 2015 19:51
@prabin5
Copy link
Contributor Author

prabin5 commented Nov 2, 2015

@igalic yes, it helped much. thanks. pushed the latest commit with fixes. cc3e55a .

igalic added a commit that referenced this pull request Nov 3, 2015
Update mime.conf.erb to support dynamic AddHandler AddType AddOutputF…
@igalic igalic merged commit 0e9b153 into puppetlabs:master Nov 3, 2015
@prabin5 prabin5 deleted the dynamic_mime_template branch November 3, 2015 16:01
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