Skip to content

Commit

Permalink
Merge pull request #693 from yast/url_no_host_schemes
Browse files Browse the repository at this point in the history
Update the URL schemes without host name (bsc#1077310)
  • Loading branch information
teclator committed Feb 15, 2018
2 parents 0e8b13e + 037d057 commit ef831e7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM yastdevel/ruby
FROM yastdevel/ruby:sle12-sp3
COPY . /usr/src/app
# English messages, UTF-8, "C" locale for numeric formatting tests
ENV LC_ALL= LANG=en_US.UTF-8 LC_NUMERIC=C
Expand Down
5 changes: 3 additions & 2 deletions library/types/src/modules/URL.rb
Expand Up @@ -655,9 +655,10 @@ def HidePasswordToken(tokens)

private

# Schemes which should not include a host.
# Schemes which should not include a host.Should be kept in sync with libzypp.
# @see https://github.com/openSUSE/libzypp/blob/d9c97b883ac1561225c4d728a5f6c8a34498d5b9/zypp/Url.cc#L184-L190
# @see #merge_host_and_path
SCHEMES_WO_HOST = ["cd", "dvd"].freeze
SCHEMES_WO_HOST = ["cd", "dvd", "hd", "iso", "dir"].freeze

# Merges host and path tokens
#
Expand Down
7 changes: 6 additions & 1 deletion library/types/test/url_test.rb
Expand Up @@ -288,7 +288,12 @@
"http://user:password@[2001:de8:0:f123::1]:8080/path/to/dir" => "http://user:password@[2001:de8:0:f123::1]:8080/path/to/dir",
"http://name:pass@www.suse.cz:80/path/index.html?question#part" => "http://name:pass@www.suse.cz:80/path/index.html?question#part",
"smb://username:passwd@servername/share/path/on/the/share?mountoptions=ro&workgroup=group" => "smb://username:passwd@servername/share/path/on/the/share?mountoptions=ro&workgroup=group",
"slp:/" => "slp://"
"slp:/" => "slp://",
"dir:/" => "dir:///",
"iso:/" => "iso:///",
"hd:/" => "hd:///",
"cd:/" => "cd:///",
"dvd:/" => "dvd:///"
}.freeze

URLS.each do |url, rebuilt|
Expand Down
7 changes: 7 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Feb 13 09:34:40 UTC 2018 - lslezak@suse.cz

- Fixed list of the URL schemes without host, fixes processing
URLs with the "hd:/" scheme (bsc#1077310)
- 3.1.219

-------------------------------------------------------------------
Fri Nov 24 17:55:50 UTC 2017 - mfilka@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 3.1.218
Version: 3.1.219
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit ef831e7

Please sign in to comment.