Excellent, I only found it today and remembered your post from a few days ago<div><br></div><div>Erik<br><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 12:45 PM, David Salgado <span dir="ltr"><<a href="mailto:david@digitalronin.com">david@digitalronin.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks, Erik. That's exactly what I was looking for. This works fine;<br>
<br>
uri = Addressable::URI.parse to_url<br>
r = Net::HTTP.get_response uri.normalize<br>
<br>
I'm updating the gem now.<br>
<font color="#888888"><br>
David<br>
</font><div><div></div><div class="h5"><br>
<br>
On 11 October 2011 10:40, Erik Eide <<a href="mailto:erik.eide@gmail.com">erik.eide@gmail.com</a>> wrote:<br>
> Hi David<br>
> Have you tried Addressable, it doesn't seem to blow up on your input:<br>
> ruby-1.9.2-p180 :002 ><br>
> Addressable::URI.parse("<a href="http://localhost/icinga-web/web/api/service/filter[AND(SERVICE_NAME%7C=%7CIn%20service;AND(SERVICE_CURRENT_STATE%7C!=%7C0))]/countColumn=SERVICE_ID/authkey=xxxxx/json" target="_blank">http://localhost/icinga-web/web/api/service/filter[AND(SERVICE_NAME%7C=%7CIn%20service;AND(SERVICE_CURRENT_STATE%7C!=%7C0))]/countColumn=SERVICE_ID/authkey=xxxxx/json</a>")<br>
> => #<Addressable::URI:0x260c140<br>
> URI:<a href="http://localhost/icinga-web/web/api/service/filter[AND(SERVICE_NAME%7C=%7CIn%20service;AND(SERVICE_CURRENT_STATE%7C!=%7C0))]/countColumn=SERVICE_ID/authkey=xxxxx/json" target="_blank">http://localhost/icinga-web/web/api/service/filter[AND(SERVICE_NAME%7C=%7CIn%20service;AND(SERVICE_CURRENT_STATE%7C!=%7C0))]/countColumn=SERVICE_ID/authkey=xxxxx/json</a>><br>
> I think it also has a parse_heuristic method that is trying to figure out<br>
> what invalid URLs should be..<br>
> <a href="https://github.com/sporkmonger/addressable" target="_blank">https://github.com/sporkmonger/addressable</a><br>
> Regards<br>
> Erik<br>
> On Sat, Oct 8, 2011 at 6:15 PM, David Salgado <<a href="mailto:david@digitalronin.com">david@digitalronin.com</a>><br>
> wrote:<br>
>><br>
>> Hi Sean<br>
>><br>
>> > Sorry if I'm stating the obvious but have you tried escaping the<br>
>> > troublesome path components?<br>
>><br>
>> Sorry, I should have mentioned that yes, I have tried various<br>
>> combinations of CGI.escape and URI.escape/encode<br>
>><br>
>> Whenever I get to something that URI.parse will accept, I just get a<br>
>> 404 error from the Icinga server!<br>
>><br>
>> > P.S. What were they smoking when they devised that scheme? I'd like<br>
>> > some.<br>
>><br>
>> I have a feeling they're just doing a straight paste of whatever<br>
>> parameters are on the URL into an SQL query ... which isn't dangerous<br>
>> at all, of course.<br>
>><br>
>> D<br>
>> _______________________________________________<br>
>> Chat mailing list<br>
>> <a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
>> <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
><br>
><br>
> _______________________________________________<br>
> Chat mailing list<br>
> <a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
> <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
><br>
><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br></div>