Skip to content

Commit d3ac4b7

Browse files
committed
Include x-client-info header
1 parent 983ed6f commit d3ac4b7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Functions/Client.cs

+13
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private static async Task<HttpResponseMessage> HandleRequest(string url, string
6666
}
6767

6868
options.Headers["Authorization"] = $"Bearer {token}";
69+
options.Headers["X-Client-Info"] = Util.GetAssemblyVersion();
6970

7071
var builder = new UriBuilder(url);
7172
var query = HttpUtility.ParseQueryString(builder.Query);
@@ -102,6 +103,18 @@ private static async Task<HttpResponseMessage> HandleRequest(string url, string
102103
}
103104
}
104105

106+
public class RequestException : Exception
107+
{
108+
public HttpResponseMessage Response { get; private set; }
109+
public ErrorResponse Error { get; private set; }
110+
111+
public RequestException(HttpResponseMessage response, ErrorResponse error) : base(error.Message)
112+
{
113+
Response = response;
114+
Error = error;
115+
}
116+
}
117+
105118
/// <summary>
106119
/// Options that can be supplied to a function invocation.
107120
///

FunctionsTests/Client.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Client
1717
public async Task Invokes()
1818
{
1919
var token = Environment.GetEnvironmentVariable("TOKEN");
20-
var endpoint = Environment.GetEnvironmentVariable("ENDPOINT");
20+
var endpoint = Environment.GetEnvironmentVariable("FUNCTION_ENDPOINT");
2121

2222
var result = await Invoke(endpoint, token, new InvokeFunctionOptions
2323
{

0 commit comments

Comments
 (0)