From 7b59d1f07bf8cf0e23f3070f97f940af3bfad843 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 23 Feb 2010 17:49:02 +0100 Subject: some test issues resolved --- lib/compound.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/compound.rb') diff --git a/lib/compound.rb b/lib/compound.rb index 56646c0..0ee853d 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -17,7 +17,8 @@ module OpenTox @inchi = sdf2inchi(params[:sdf]) @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:name] - @inchi = RestClient.get("#{@@cactus_uri}#{params[:name]}/stdinchi").chomp + # paranoid URI encoding to keep SMILES charges and brackets + @inchi = RestClient.get("#{@@cactus_uri}#{URI.encode(params[:name], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}/stdinchi").chomp @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:uri] @uri = params[:uri] -- cgit v1.2.3