-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcore.patch
110 lines (106 loc) · 3.08 KB
/
core.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Index: core/oauthbase.cs
===================================================================
--- core/oauthbase.cs (revision 1216)
+++ core/oauthbase.cs (working copy)
@@ -15,6 +15,23 @@
/// Edited by Claudio Cherubino and Alain Vongsouvanh
/// </summary>
public class OAuthBase {
+ private static IWebProxy _proxy;
+
+ public static IWebProxy Proxy
+ {
+ get
+ {
+ return _proxy;
+ }
+ set
+ {
+ _proxy = value;
+ }
+ }
+
+
+
+
public static string OAuthVersion = "1.0";
public static string OAuthParameterPrefix = "oauth_";
@@ -438,7 +455,7 @@
Uri requestUri = new Uri(parameters.TokenUri);
WebRequest request = WebRequest.Create(requestUri);
request.Method = "POST";
-
+ request.Proxy = _proxy;
request.ContentType = "application/x-www-form-urlencoded";
Stream outputStream = request.GetRequestStream();
Index: core/oauthutil.cs
===================================================================
--- core/oauthutil.cs (revision 1216)
+++ core/oauthutil.cs (working copy)
@@ -28,6 +28,24 @@
/// with Google OAuth requests.
/// </summary>
public class OAuthUtil {
+ private static IWebProxy _proxy;
+
+ public static IWebProxy Proxy
+ {
+ get
+ {
+ return _proxy;
+ }
+ set
+ {
+ OAuthBase.Proxy = value;
+ _proxy = value;
+ }
+ }
+
+
+
+
// Google OAuth endpoints
private static String requestTokenUrl = "https://www.google.com/accounts/OAuthGetRequestToken";
private static String userAuthorizationUrl = "https://www.google.com/accounts/OAuthAuthorizeToken";
@@ -115,7 +133,7 @@
string headers = GenerateHeader(requestUri, "GET", parameters);
WebRequest request = WebRequest.Create(requestUri);
request.Headers.Add(headers);
-
+ request.Proxy = _proxy;
WebResponse response = request.GetResponse();
string result = "";
if (response != null) {
@@ -182,6 +200,7 @@
string headers = GenerateHeader(requestUri, "GET", parameters);
WebRequest request = WebRequest.Create(requestUri);
request.Headers.Add(headers);
+ request.Proxy = _proxy;
WebResponse response = request.GetResponse();
string result = "";
Index: core/request.cs
===================================================================
--- core/request.cs (revision 1216)
+++ core/request.cs (working copy)
@@ -278,6 +278,22 @@
return this.customHeaders;
}
}
+
+ public IWebProxy Proxy
+ {
+ get
+ {
+ return this.webProxy;
+ }
+ set
+ {
+ this.webProxy = value;
+ }
+ }
+
+
+
+
}
/// <summary>base GDataRequest implementation</summary>