You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jordan (JIRA)" <ji...@apache.org> on 2010/07/04 11:36:49 UTC

[jira] Created: (THRIFT-813) Getting URL encoded strings back on the server side.

Getting URL encoded strings back on the server side. 
-----------------------------------------------------

                 Key: THRIFT-813
                 URL: https://issues.apache.org/jira/browse/THRIFT-813
             Project: Thrift
          Issue Type: Bug
    Affects Versions: 0.4
         Environment: Linux server, web based js thrift client
            Reporter: Jordan
            Priority: Minor


Hello, 

Please help me understand what is going on. 
I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
hi@bye.com would be hi%40bye.com

Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "T Jake Luciani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886168#action_12886168 ] 

T Jake Luciani commented on THRIFT-813:
---------------------------------------

Hi Jordan,

This too is most a browser side encoding issue.    The js implementation of writeString uses encodeURIComponent()

I suppose this isn't consistent, with the non javascript protocol readers.  but the js readString uses decodeURIComponent()

We could implement our own encoder to encode only JSON special chars.

-Jake

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-813.
--------------------------------

       Resolution: Duplicate
    Fix Version/s: 0.5

is a clone of THRIFT-885, which is resolved

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>             Fix For: 0.5
>
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885569#action_12885569 ] 

Bryan Duxbury commented on THRIFT-813:
--------------------------------------

It could be in Java's TJSONProtocol implementation. I'm not super familiar with that implementation, so I don't know where to look off hand, but maybe you could add a test case that exercises this?

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886133#action_12886133 ] 

Bryan Duxbury commented on THRIFT-813:
--------------------------------------

bq. Where would I look in order to debug what's going on? What part of the TJSONProtocol would this be in. 

I have no idea - TJSONProtocol.java is a big file, and I didn't write it. personally, I'd just grep around for any occurrence of the @ sign or something that indicates URL-encoding is going on. 

bq. Also, I've seen several bugs (I think) and I'd like to learn some about the code base. Are there any ramp up docs for contributors?

Sadly, not really. It's a bit of a jungle in there. The very first thing to do in every case is to open a JIRA ticket so that we have a record of the bug. From there, either get out your machete and safari hat and dig in, or try to find someone who can fix it for you.

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Jordan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886121#action_12886121 ] 

Jordan commented on THRIFT-813:
-------------------------------

Bryan, 

Where would I look in order to debug what's going on? What part of the TJSONProtocol would this be in. 

Also, I've seen several bugs (I think) and I'd like to learn some about the code base. Are there any ramp up docs for contributors?




> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Jordan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886397#action_12886397 ] 

Jordan commented on THRIFT-813:
-------------------------------

Jake, 

What you're saying sound correct, because when I pass the string to the server, and then back to the browser, it's back to the original form. 
The only problem, is that when the string shows up on the server, its encoded. We need it automatically decoded on the server, which is why I suspected TJSONProtocol.

URLEncoding is not part of the json spec (only quote escaping, I believe). It's just that to get the data across the wire in post form, we need to encode it (i think.)

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Chad Walters (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886162#action_12886162 ] 

Chad Walters commented on THRIFT-813:
-------------------------------------

I wrote TJSONProtocol. There may certainly be some bugs but I don't think this URL encoding issue is coming from TJSONProtocol -- I am pretty sure there is no URL encoding done inside TJSONProtocol -- see JSON spec  at www.json.org.

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-813) Getting URL encoded strings back on the server side for example: ("@" becomes "%40")

Posted by "Jordan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jordan updated THRIFT-813:
--------------------------

     Summary: Getting URL encoded strings back on the server side for example: ("@" becomes "%40")   (was: Getting URL encoded strings back on the server side. )
    Priority: Major  (was: Minor)

> Getting URL encoded strings back on the server side for example: ("@" becomes "%40") 
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-813
>                 URL: https://issues.apache.org/jira/browse/THRIFT-813
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.4
>         Environment: Linux server, web based js thrift client
>            Reporter: Jordan
>
> Hello, 
> Please help me understand what is going on. 
> I'm using the js client for thrift and making calls to a java-bean thrift server. In the server implementation, I examine the strings that are passed through a service call, and they are URL encoded. For example.
> hi@bye.com would be hi%40bye.com
> Where is this happening. I'm guessing it's at the TJSONProtocol. I expect many characters to be percent escaped like this as it's coming across the wire, but once it gets to the server code it should be back in plain ol' string land. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.