Skip to content

Commit

Permalink
* fix proxy setup for queries
Browse files Browse the repository at this point in the history
  • Loading branch information
meancrazy committed Feb 22, 2016
1 parent 15bee63 commit d3f41a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CustomizedRequestMessage.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.Net;
using Microsoft.OData.Client;

namespace OData4
{
public class CustomizedRequestMessage : HttpWebRequestMessage
{
public CustomizedRequestMessage(DataServiceClientRequestMessageArgs args)
: base(args)
public CustomizedRequestMessage(DataServiceClientRequestMessageArgs args, IWebProxy webProxy) : base(args)
{
HttpWebRequest.Proxy = LINQPad.Util.GetWebProxy();
HttpWebRequest.Proxy = webProxy;
}
}
}
5 changes: 3 additions & 2 deletions OData4DynamicDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,12 @@ public override void InitializeContext(IConnectionInfo cxInfo, object context, Q
{
var dsContext = (DataServiceContext)context;

dsContext.Credentials = cxInfo.GetConnectionProperties().GetCredentials();
var properties = cxInfo.GetConnectionProperties();
dsContext.Credentials = properties.GetCredentials();

dsContext.Configurations.RequestPipeline.OnMessageCreating += args =>
{
var message = new CustomizedRequestMessage(args);
var message = new CustomizedRequestMessage(args, properties.GetWebProxy());
return message;
};

Expand Down

0 comments on commit d3f41a8

Please sign in to comment.