Skip to content

Commit

Permalink
More URL encoding fixes similar to linvi#711
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshKeegan committed May 24, 2018
1 parent 19014fe commit cd25c67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Tweetinvi.Controllers/Tweet/TweetQueryGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public string GetTweetsQuery(IEnumerable<long> tweetIds)
throw new ArgumentException("Tweet Ids cannot be empty.");
}

// Uses URL encoded comma (%2C) so that the parameter doesn't need to be URL encoded
var idsParameter = string.Join("%2C", tweetIdsAsList);

var query = new StringBuilder(string.Format(Resources.Tweet_Lookup, idsParameter));
Expand Down Expand Up @@ -100,8 +101,7 @@ public string GetPublishTweetQuery(IPublishTweetParameters queryParameters)
query.AddParameterToQuery("auto_populate_reply_metadata", queryParameters.AutoPopulateReplyMetadata);
if (queryParameters.ExcludeReplyUserIds != null)
{
// Use URL encoded comma %2C so we don't need to URL encode the string afterwards
query.AddParameterToQuery("exclude_reply_user_ids", String.Join("%2C", queryParameters.ExcludeReplyUserIds));
query.AddParameterToQuery("exclude_reply_user_ids", String.Join(",", queryParameters.ExcludeReplyUserIds));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tweetinvi.Controllers/Upload/UploadQueryGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public string GetChunkedUploadInitQuery(IChunkUploadInitParameters parameters)

if (parameters.AdditionalOwnerIds != null && parameters.AdditionalOwnerIds.Any())
{
var ids = string.Join("%2C", parameters.AdditionalOwnerIds.Select(x => x.ToString()));
var ids = string.Join(",", parameters.AdditionalOwnerIds.Select(x => x.ToString()));
initQuery.AddParameterToQuery("additional_owners", ids);
}

Expand Down

0 comments on commit cd25c67

Please sign in to comment.