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

Use URI escaping in CDNSource #554

Merged
merged 1 commit into from
Jul 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

##### Bug Fixes

* None.
* Use URI escaping in `CDNSource`.
[Igor Makarov](https://github.com/igor-makarov)
[#554](https://github.com/CocoaPods/Core/pull/554)
[CocoaPods#8951](https://github.com/CocoaPods/CocoaPods/issues/8951)


## 1.7.3 (2019-06-28)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-core/cdn_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def relative_pod_path(pod_name)
end

def download_file(partial_url)
file_remote_url = url + partial_url.to_s
file_remote_url = URI.encode(url + partial_url.to_s)
path = repo + partial_url

if File.exist?(path)
Expand Down
5 changes: 5 additions & 0 deletions spec/cdn_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ def all_local_files
@source.versions('Unknown_Pod').should.be.nil
end

it 'does not error when a Pod name need URI escaping' do
@source.versions('СерафимиМногоꙮчитїи').map(&:to_s).should == %w(1.0.0)
@source.specification('СерафимиМногоꙮчитїи', '1.0.0').name.should == 'СерафимиМногоꙮчитїи'
end

it 'raises if unexpected HTTP error' do
REST.expects(:get).returns(REST::Response.new(500))
should.raise Informative do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "СерафимиМногоꙮчитїи",
"version": "1.0.1",
"summary": "Beacon detection framework using CoreBluetooth",
"description": "This is a framework that wraps around CoreBluetooth and detects beacons of different types.\nTested to compile with Swift 3.1, 3.2 & 4.0 for iOS 9.0 & macOS 10.12\nThe currently supported types are: Eddystone-UID, Eddystone-URL, AltBeacon, iBeacon.",
"homepage": "https://github.com/igor-makarov/BeaconKit",
"license": "MIT",
"authors": {
"Igor Makarov": "igormaka@gmail.com"
},
"source": {
"git": "https://github.com/igor-makarov/BeaconKit.git",
"tag": "1.0.1"
},
"platforms": {
"ios": "9.0",
"osx": "10.12"
},
"source_files": "Sources/Core/**/*.swift",
"pushed_with_swift_version": "3.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
СерафимиМногоꙮчитїи/1.0.0