6

Assuming the following naive code:

$app->get( '(/store(/:url)+)', function( $url = NULL ) use ( $app ) 
    {
        // Execute actions on $url
    });

The above works fine for the following:

http://localhost/api/0001/store/url-data

But it fails for:

http://localhost/api/0001/store/http%3A%2F%2Fexample.com%2FSomething
http://localhost/api/0001/store/http://example.com/Something

// and other variations

I wish to pass a full encoded URI to handle on the server side. How can I manage to do that with Slim?

Notes:

Other types of HTTP Requests (POST, PUT) won't work for this given problem.

It can be solved on the other end by reformatting (serializing) the URI, but I wish this to be my last resort.

Important Edit - Answer

So it turns out the above is a bug in the framework which is currently being tested and hopefully fixed and released soon. I solved the problem temporarily by serializing the URI before it reaches the server side.

4

1 回答 1

0

所以事实证明,上述是框架中的一个错误,目前正在测试中,希望很快得到修复和发布。我通过在 URI 到达服务器端之前对其进行序列化暂时解决了这个问题。

于 2014-10-29T13:25:02.603 回答