streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STREAMS-508) Utilize new third-party rest proxy capability in provider-twitter
Date Wed, 21 Jun 2017 02:43:00 GMT

    [ https://issues.apache.org/jira/browse/STREAMS-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16056882#comment-16056882
] 

ASF GitHub Bot commented on STREAMS-508:
----------------------------------------

Github user steveblackmon commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/368#discussion_r123142711
  
    --- Diff: streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/api/TwitterOAuthRequestInterceptor.java
---
    @@ -84,16 +85,20 @@ public void process(HttpRequest httpRequest, HttpContext httpContext)
throws Htt
         oauthParamMap.put("oauth_version", oauth_version);
     
         String request_host = ((HttpRequestWrapper)httpRequest).getTarget().toString().replace(":443","");
    -    String request_path = httpRequest.getRequestLine().getUri().substring(0, httpRequest.getRequestLine().getUri().indexOf('?'));
    -    String request_param_line = httpRequest.getRequestLine().getUri().substring(httpRequest.getRequestLine().getUri().indexOf('?')+1);
    -    String[] request_params = URLDecoder.decode(request_param_line).split("&");
    +    String request_path = httpRequest.getRequestLine().getUri();
     
         Map<String,String> allParamsMap = new HashMap<>(oauthParamMap);
     
    -    for( String request_param : request_params ) {
    -      String key = request_param.substring(0, request_param.indexOf('='));
    -      String value = request_param.substring(request_param.indexOf('=')+1, request_param.length());
    -      allParamsMap.put(key, value);
    +    if( request_path.contains("?")) {
    --- End diff --
    
    having now looked into that class, i agree that using it could reduce number of lines
of code.  on the other hand, I just tried to rewrite the class to use it (changed ~100 lines)
and the unit tests are failing without a clear remedy. so i'm going to note this on a new
ticket and attach a patch file.  it took a LOT of tweaking and testing to get the as-is implementation
working...


> Utilize new third-party rest proxy capability in provider-twitter
> -----------------------------------------------------------------
>
>                 Key: STREAMS-508
>                 URL: https://issues.apache.org/jira/browse/STREAMS-508
>             Project: Streams
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
>            Assignee: Steve Blackmon
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Requires upgrade juneau dependency to 6.2.1 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message