Skip to content

Commit

Permalink
Merge pull request #467 from cloudfoundry/open-compression-feature
Browse files Browse the repository at this point in the history
compression feature added
  • Loading branch information
kevin-ortega authored Jul 22, 2020
2 parents fa06f05 + 5f8e27b commit a2e2ae2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/liberty_buildpack/container/liberty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ def update_http_endpoint(server_xml_doc)
endpoint.add_attribute('host', '*')
end
endpoint.add_attribute('httpPort', "${#{KEY_HTTP_PORT}}")
endpoint.add_element('compression')
endpoint.delete_attribute('httpsPort')
end

Expand Down
17 changes: 17 additions & 0 deletions spec/liberty_buildpack/container/liberty_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,23 @@ def check_appstate(app_xml, app_name, configuration = default_configuration)
end
end

def check_compression_feature(app_xml, app_name, configuration = default_configuration)
Dir.mktmpdir do |root|
root = File.join(root, 'app')
generate(root, app_xml, configuration)
liberty_directory = File.join root, '.liberty'
expect(Dir.exist?(liberty_directory)).to eq(true)
server_xml_file = File.join(root, 'wlp', 'usr', 'servers', 'myServer', 'server.xml')
server_xml_contents = File.read(server_xml_file)
expect(server_xml_contents).to include("<httpDispatcher enableWelcomePage='false' trustedSensitiveHeaderOrigin='*'/>")
expect(server_xml_contents).to include("<config updateTrigger='polled' monitorInterval='60000ms'/>")
expect(server_xml_contents).to include("<applicationMonitor dropinsEnabled='false' updateTrigger='mbean'/>")
expect(server_xml_contents).to include("<appstate2 appName='#{app_name}'/>")
expect(server_xml_contents).to include('<compression/>')
expect(server_xml_contents).to match(/httpEndpoint id="defaultHttpEndpoint" host="127.0.0.1"/)
end
end

def check_no_appstate(app_xml, configuration = default_configuration)
Dir.mktmpdir do |root|
root = File.join(root, 'app')
Expand Down

0 comments on commit a2e2ae2

Please sign in to comment.