-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
extensions/Worker.Extensions.Http.AspNetCore/src/HttpContextReference.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
extensions/Worker.Extensions.Http.AspNetCore/src/HttpUriProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using Microsoft.Azure.Functions.Worker.Core.Http; | ||
|
||
namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore | ||
{ | ||
internal static class HttpUriProvider | ||
{ | ||
private static Uri? _httpUri; | ||
|
||
public static Lazy<int> HttpPort = new Lazy<int>(() => Utilities.GetUnusedTcpPort()); | ||
|
||
public static Uri GetHttpUri() | ||
{ | ||
if (_httpUri is not null) | ||
{ | ||
return _httpUri; | ||
} | ||
|
||
// TODO: replace local host string | ||
var uriString = "http://localhost:" + HttpPort.Value.ToString(); | ||
|
||
return new Uri(uriString); | ||
} | ||
|
||
public static string GetHttpUriAsString() | ||
{ | ||
return GetHttpUri().ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters