-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Escape URL before converting to URI; catch Addressable::URI::Inv…
…alidURIError (#100) This allows URLs with spaces in, as they were previously re-escaped (in v3.5.0). We now also catch the Addressable::URI::InvalidURIError, as that might be raised while escaping if URI is invalid.
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<definitions | ||
xmlns="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" | ||
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" | ||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | ||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:s="http://www.w3.org/2001/XMLSchema" | ||
xmlns:actions="http://example.com/actions" | ||
targetNamespace="http://example.com/topLevelNamespace"> | ||
<types> | ||
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/actions"> | ||
<s:element name="SomeRequest"> | ||
<s:complexType> | ||
<s:sequence> | ||
<s:element name="status" type="s:string"/> | ||
</s:sequence> | ||
</s:complexType> | ||
</s:element> | ||
</s:schema> | ||
</types> | ||
<message name="SomeInput"> | ||
<part name="parameters" element="actions:SomeRequest"/> | ||
</message> | ||
<message name="SomeOutput"> | ||
<part name="parameters" element="actions:SomeResponse"/> | ||
</message> | ||
<portType name="ExamplePortType"> | ||
<operation name="SomeOperation"> | ||
<input message="actions:SomeInput"/> | ||
<output message="actions:SomeOutput"/> | ||
</operation> | ||
</portType> | ||
<binding name="ExampleBinding" type="actions:ExamplePortType"> | ||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> | ||
<operation name="SomeOperation"> | ||
<soap:operation soapAction="http://example.com/actions.SomeOperation" style="document"/> | ||
<input> | ||
<soap:body use="literal"/> | ||
</input> | ||
<output> | ||
<soap:body use="literal"/> | ||
</output> | ||
</operation> | ||
</binding> | ||
<service name="ExampleService"> | ||
<port name="ExamplePort" binding="actions:ExampleBinding"> | ||
<soap:address location="http://localhost/soap%20service"/> | ||
</port> | ||
</service> | ||
</definitions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
require "spec_helper" | ||
|
||
describe Wasabi::Document do | ||
context "with: escaped_endpoint.wsdl" do | ||
|
||
subject(:document) { Wasabi::Document.new fixture(:escaped_endpoint).read } | ||
|
||
describe '#endpoint' do | ||
it "supports spaces in URIs" do | ||
expect(document.endpoint).to eq URI("http://localhost/soap%20service") | ||
end | ||
end | ||
|
||
end | ||
end |