SparkleNetworks / LinkedInNET

Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)
https://www.nuget.org/packages/Sparkle.LinkedInNET/
GNU Lesser General Public License v3.0
35 stars 51 forks source link

Missing URL escape in FormatUrl calls #22

Closed sandrock closed 6 years ago

sandrock commented 6 years ago

URLs composed internally with the FormatUrl method are sometimes invalid. URL escaping is not done.

Example: calling GetPublicProfile(..., "http://www.linkedin.com/in/jeffweiner08", ..., ...) fails:

[LinkedInApiException: API error (400) Unknown field {www.linkedin.com} in resource {Person} at https://api.linkedin.com/v1/people/url=http://www.linkedin.com/in/jeffweiner08:(id,positions:(id,title,start-date,end-date,is-current,company),picture-url,first-name,last-name,headline,languages:(id,language,proficiency),connections)]
   Sparkle.LinkedInNET.Internals.BaseApi.ThrowJsonErrorResult(RequestContext context, ApiError errorResult, String json) in src\NET35.Sparkle.LinkedInNET\Internals\BaseApi.cs:589
   Sparkle.LinkedInNET.Internals.BaseApi.HandleJsonResponse(RequestContext context) in src\NET35.Sparkle.LinkedInNET\Internals\BaseApi.cs:438
   Sparkle.LinkedInNET.Internals.BaseApi.HandleJsonErrorResponse(RequestContext context) in src\NET35.Sparkle.LinkedInNET\Internals\BaseApi.cs:265
   Sparkle.LinkedInNET.Profiles.ProfilesApi.GetPublicProfile(UserAuthorization user, String publicProfileUrl, String[] acceptLanguages, FieldSelector`1 fields) in src\NET35.Sparkle.LinkedInNET\Services.tt.cs:5737
   Sparkle.LinkedInNET.DemoMvc5.Controllers.ExploreController.PublicProfile(String url, String culture) in src\NET45.Sparkle.LinkedInNET.DemoMvc5\Controllers\ExploreController.cs:402
   lambda_method(Closure , ControllerBase , Object[] ) +147
sandrock commented 6 years ago

Fix in https://github.com/SparkleNetworks/LinkedInNET/commit/db8e31be41bdc1944227693bf116686fd0a2cd60 Will push new nuget package.

sandrock commented 6 years ago

Sparkle.LinkedInNET pushed