bcquality/microsoft/knowledge/security/validate-user-configurable-urls-before-http-calls.good.al
Jesper Schulz-Wedde 5bcdc55df9 Sync knowledge articles with review agent instructions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-05 14:08:32 +02:00

17 lines
466 B
AL

codeunit 50240 "Sec Sample Url Good"
{
procedure Sync(ServiceUrl: Text)
var
Client: HttpClient;
Response: HttpResponseMessage;
Uri: Codeunit Uri;
ExpectedBaseUrl: Text;
begin
ExpectedBaseUrl := 'https://api.contoso.com';
if not Uri.AreURIsHaveSameHost(ServiceUrl, ExpectedBaseUrl) then
Error('Service URL must point to api.contoso.com.');
Client.Get(ServiceUrl, Response);
end;
}