Skip to content

Commit

Permalink
fix to nginx upload path in cloudcontroller to support situation where
Browse files Browse the repository at this point in the history
there is no uploaded file i.e. all bits already in the resources pool.

Change-Id: I9b4e0396b0461cc6bcc084dfec37f36a0b7517d2
  • Loading branch information
Tal Garfinkel committed Nov 2, 2011
1 parent 185cbbf commit e1c500f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions cloud_controller/app/controllers/apps_controller.rb
Expand Up @@ -53,18 +53,21 @@ def valid_upload_path?(path)
end

def get_uploaded_file
file = nil
if CloudController.use_nginx
path = params[:application_path]
if not valid_upload_path?(path)
CloudController.logger.warn "Illegal path: #{path}, passed to cloud_controller
something is badly misconfigured or insecure!!!"
raise CloudError.new(CloudError::FORBIDDEN)
end
wrapper_class = Class.new do
attr_accessor :path
if path != nil
if not valid_upload_path?(path)
CloudController.logger.warn "Illegal path: #{path}, passed to cloud_controller
something is badly misconfigured or insecure!!!"
raise CloudError.new(CloudError::FORBIDDEN)
end
wrapper_class = Class.new do
attr_accessor :path
end
file = wrapper_class.new
file.path = path
end
file = wrapper_class.new
file.path = path
else
file = params[:application]
end
Expand Down

0 comments on commit e1c500f

Please sign in to comment.