Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValenceAuthenticator overwrites request.Resource #5

Open
ghost opened this issue Feb 19, 2014 · 2 comments
Open

ValenceAuthenticator overwrites request.Resource #5

ghost opened this issue Feb 19, 2014 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 19, 2014

in ValenceAuthenticator.Authenticate, we overwrite request.Resource with the value from the uri that is computed by RestClient.BuildUri. This means we overwrite any url arg placeholders with their values. So the following code would break:

...
var request = new RestRequest( "/foo/{bar}" );
request.AddUrlSegment( "bar", "123" );
authenticator.Authenticate( request );
// execute request...
request.AddUrlSegment( "bar", "456" ); // won't work: {bar} is gone
authenticator.Authenticate( request );
// execute this new request...

It seems like RestSharp wants to allow this functionality but it is probably uncommon.

@ghost ghost added the bug label Feb 19, 2014
@ghost
Copy link
Author

ghost commented Feb 19, 2014

A workaround for this is to not authenticate until the request is about to be sent and ensure that all URL segments have been added.

@ghost
Copy link
Author

ghost commented Feb 19, 2014

I mean you might send the request and then want to send a duplicate request, but change a url parameter - I think this is technically possible with RestSharp but may not be an intended usage scenario. It certainly seems... unlikely to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants