You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Chris Chabot (JIRA)" <ji...@apache.org> on 2009/02/19 00:14:01 UTC
[jira] Commented: (SHINDIG-928) URL encoding for makeRequest HTTP
GET requests not preserved
[ https://issues.apache.org/jira/browse/SHINDIG-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674821#action_12674821 ]
Chris Chabot commented on SHINDIG-928:
--------------------------------------
Hey Brent,
Indeed, while working on some of the deeper changes of 0.9 we'll be seeing a few random bugs pop up here and there, the 1.0.x branch is a safer place to be right now for anything that should just work :)
However the bug report in it's self is still valid so thanks for that :)
Ii think this would probably fix this issue (i'll make sure to include the fix in the trunk too):
Index: servlet/MakeRequestServlet.php
===================================================================
--- servlet/MakeRequestServlet.php (revision 744702)
+++ servlet/MakeRequestServlet.php (working copy)
@@ -35,7 +35,7 @@
try {
$this->noHeaders = true;
$context = new GadgetContext('GADGET');
- $url = urldecode(isset($_GET['url']) ? $_GET['url'] : (isset($_POST['url']) ? $_POST['url'] : false));
+ $url = isset($_GET['url']) ? $_GET['url'] : (isset($_POST['url']) ? $_POST['url'] : false);
if (! $url || empty($url)) {
header("HTTP/1.0 400 Bad Request", true);
echo "<html><body><h1>400 - Missing url parameter</h1></body></html>";
> URL encoding for makeRequest HTTP GET requests not preserved
> ------------------------------------------------------------
>
> Key: SHINDIG-928
> URL: https://issues.apache.org/jira/browse/SHINDIG-928
> Project: Shindig
> Issue Type: Bug
> Components: PHP
> Affects Versions: trunk
> Environment: Firefox 3.0.6, MAMP 1.7.1
> Reporter: Brent Theisen
>
> I'm calling makeRequest like so...
> var params = { };
> params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
> params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
> gadgets.io.makeRequest(
> "http://local.api.madison.com/article/v1/search.json?tags=Local+News&limit=5&hasImages=1", function(response) {
> // Omitted
> }, params);
> The callback never gets invoked and I traced the JS to an error in io.js line 122 (rev 739404) that does, "data = data[url];". The reason for the error is that the "+" in the URL has been decoded up on the server side to just a space and never got re-encoded. Also, when the server side shindig code attempts to proxy the request with curl it uses a space instead of a + so the URL more or less gets truncated.
> I know this was working late last week so it might have been a recently introduced bug in the trunk. I tried some previous revisions of shindig with the gadget that makes this particular makeRequest() call and found that it broke beginning with revision 744702. With 744702 the gadget doesn't render at all and I get a debug iframe saying, "Invalid view specified for this gadget". With the next revision (744733), I get the same behavior I described above. So I guess this bug was introduced with revision 744702.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.