Skip to content

Commit

Permalink
Merge pull request #12304 from danidoni/replace-uri-encode-with-cgi-u…
Browse files Browse the repository at this point in the history
…nescape

URI.encode is removed, use Addressable::URI.encode
  • Loading branch information
hennevogel committed Mar 14, 2022
2 parents c16a99b + 9ea5647 commit a39f185
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/app/models/package_file.rb
Expand Up @@ -6,6 +6,6 @@ class PackageFile < Backend::File

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/#{package_name}/#{name}") + "?#{query.to_query}"
Addressable::URI.encode("/source/#{project_name}/#{package_name}/#{name}") + "?#{query.to_query}"
end
end
2 changes: 1 addition & 1 deletion src/api/app/models/project_config_file.rb
Expand Up @@ -6,7 +6,7 @@ def initialize(attributes = {})

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/#{name}") + "?#{query.to_query}"
Addressable::URI.encode("/source/#{project_name}/#{name}") + "?#{query.to_query}"
end

# You dont want to change name of _config
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/project_file.rb
Expand Up @@ -11,6 +11,6 @@ class ProjectFile < Backend::File

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/_project/#{name}") + "?#{query.to_query}"
Addressable::URI.encode("/source/#{project_name}/_project/#{name}") + "?#{query.to_query}"
end
end
2 changes: 1 addition & 1 deletion src/api/app/models/project_meta_file.rb
Expand Up @@ -6,7 +6,7 @@ def initialize(attributes = {})

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/#{name}") + "?#{query.to_query}"
Addressable::URI.encode("/source/#{project_name}/#{name}") + "?#{query.to_query}"
end

# You dont want to change name of _meta
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/backend/file_spec.rb
Expand Up @@ -20,7 +20,7 @@
attr_accessor :somefile

def full_path(_query)
URI.encode(somefile)
Addressable::URI.encode(somefile)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/request_controller_test.rb
Expand Up @@ -1333,7 +1333,7 @@ def test_search_and_involved_requests
assert_xml_tag(tag: 'request', attributes: { id: id })

# via POST
post '/search/request', params: URI.encode("match=(state/@name='new' or state/@name='review') and (action/target/@project='kde4' and action/target/@package='wpa_supplicant')")
post '/search/request', params: Addressable::URI.encode("match=(state/@name='new' or state/@name='review') and (action/target/@project='kde4' and action/target/@package='wpa_supplicant')")
assert_response :success
assert_xml_tag(tag: 'request', attributes: { id: id })

Expand Down

0 comments on commit a39f185

Please sign in to comment.