Skip to content

Commit aebe99d

Browse files
authored
Merge pull request #100 from umbraco/feature/shopify-outh
Feature/shopify outh
2 parents 7e81939 + 3b89c69 commit aebe99d

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

src/Umbraco.Cms.Integrations.OAuthProxy/Controllers/OAuthProxyController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ private HttpClient GetClient(string serviceName)
6363

6464
// Shopify's endpoint (and potentially others in future) for retrieving the access token is directly coupled with the shop's name.
6565
// As a result the address of the client needs to be updated with the request header value for the name of the shop.
66-
var serviceAddressReplaceHeader = Request.Headers.FirstOrDefault(p => p.Key.Contains(ServiceAddressReplacePrefixHeaderKey));
66+
var serviceAddressReplaceHeader = Request.Headers.FirstOrDefault(p => p.Key.ToLowerInvariant().Contains(ServiceAddressReplacePrefixHeaderKey));
6767
if (!serviceAddressReplaceHeader.Equals(default(KeyValuePair<string, StringValues>)) && httpClient.BaseAddress != null)
6868
{
69-
var replaceKey = serviceAddressReplaceHeader.Key.Replace(ServiceAddressReplacePrefixHeaderKey, string.Empty);
69+
var replaceKey = serviceAddressReplaceHeader.Key.ToLowerInvariant().Replace(ServiceAddressReplacePrefixHeaderKey, string.Empty);
7070

7171
var baseAddress = httpClient.BaseAddress.ToString().Replace($"{replaceKey}", serviceAddressReplaceHeader.Value);
7272
httpClient.BaseAddress = new Uri(baseAddress);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
3+
namespace Umbraco.Cms.Integrations.OAuthProxy.Controllers
4+
{
5+
[ApiController]
6+
public class ShopifyComplianceController : Controller
7+
{
8+
/// <summary>
9+
/// Handles customer data requests from Shopify
10+
/// </summary>
11+
/// <returns></returns>
12+
[HttpPost]
13+
[Route("/shopify-compliance/v1/customer/data-request")]
14+
public IActionResult CustomerDataRequest() => Ok();
15+
16+
/// <summary>
17+
/// Handles customer data erasure requests from Shopify
18+
/// </summary>
19+
/// <returns></returns>
20+
[HttpPost]
21+
[Route("/shopify-compliance/v1/customer/data-redact")]
22+
public IActionResult CustomerDataRedact() => Ok();
23+
24+
/// <summary>
25+
/// Handles shop data erasure requests from Shopify
26+
/// </summary>
27+
/// <returns></returns>
28+
[HttpPost]
29+
[Route("/shopify-compliance/v1/shop/data-redact")]
30+
public IActionResult ShopDataRedact() => Ok();
31+
}
32+
}

0 commit comments

Comments
 (0)