* Use named HttpClients * Register as named client * Set headers on request message. * Add User agent header to http client * Add headers within Try-catch * Add using for HttpResponseMessage * Update src/Umbraco.Infrastructure/BackgroundJobs/Jobs/WebhookFiring.cs Co-authored-by: Ronald Barendse <ronald@barend.se> * Update src/Umbraco.Infrastructure/BackgroundJobs/Jobs/WebhookFiring.cs Co-authored-by: Kenn Jacobsen <kja@umbraco.dk> * Log key instead of entire webhook * Update src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs Co-authored-by: Ronald Barendse <ronald@barend.se> * Create constant for User agent header name * Update src/Umbraco.Infrastructure/BackgroundJobs/Jobs/WebhookFiring.cs Co-authored-by: Ronald Barendse <ronald@barend.se> * Use datetime.now --------- Co-authored-by: Zeegaan <nge@umbraco.dk> Co-authored-by: Ronald Barendse <ronald@barend.se> Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
32 lines
915 B
C#
32 lines
915 B
C#
namespace Umbraco.Cms.Core;
|
|
|
|
/// <summary>
|
|
/// Defines constants.
|
|
/// </summary>
|
|
public static partial class Constants
|
|
{
|
|
/// <summary>
|
|
/// Defines constants for named http clients.
|
|
/// </summary>
|
|
public static class HttpClients
|
|
{
|
|
/// <summary>
|
|
/// Name for http client which ignores certificate errors.
|
|
/// </summary>
|
|
public const string IgnoreCertificateErrors = "Umbraco:HttpClients:IgnoreCertificateErrors";
|
|
|
|
/// <summary>
|
|
/// Name for http client which sends webhook requests.
|
|
/// </summary>
|
|
public const string WebhookFiring = "Umbraco:HttpClients:WebhookFiring";
|
|
|
|
public static class Headers
|
|
{
|
|
/// <summary>
|
|
/// User agent name for the product name.
|
|
/// </summary>
|
|
public const string UserAgentProductName = "Umbraco-Cms";
|
|
}
|
|
}
|
|
}
|