Skip to content

Commit

Permalink
Fixed marklogic-community#397: removing REST prop error-format dynami…
Browse files Browse the repository at this point in the history
…cally
  • Loading branch information
grtjn committed Mar 5, 2015
1 parent 0f1addc commit 00dd473
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions deploy/lib/ml_rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def initialize(options)
})
@request = {}
@gmt_offset = Time.now.gmt_offset
@server_version = options[:server_version]

end

Expand Down Expand Up @@ -47,6 +48,12 @@ def install_properties(path)
# Properties file needs to be updated
raise ExitException.new "#{d} is in an old format; changes to this file won't take effect. See https://github.com/marklogic/roxy/wiki/REST-properties-format-change"
else
copy = ""+ contents
copy = copy.gsub(/<!--.*?-->/m, '')
if @server_version > 7 && copy.match('<error-format')
@logger.info "WARN: REST property error-format has been deprecated since MarkLogic 8"
contents = copy.gsub(/<error-format[^>]*>[^<]+<\/error-format>/m, '')
end
# Properties is in the correct format
# @logger.debug "methods: #{methods}"
url = "http://#{@hostname}:#{@port}/v1/config/properties"
Expand Down
3 changes: 2 additions & 1 deletion deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,8 @@ def mlRest
:server => @hostname,
:app_port => @properties["ml.app-port"],
:rest_port => @properties["ml.rest-port"],
:logger => @logger
:logger => @logger,
:server_version => @server_version
})
else
@mlRest
Expand Down

0 comments on commit 00dd473

Please sign in to comment.