Master-URL: ongeldige of placeholder-waarde wordt nooit opgeslagen of verstuurd (master slaat achtergrondchecks over, slave weigert met 400, poller meldt invalid_master_url); veilige diagnostiek bij een mislukte poll; releasenote Master__MasterUrl
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using FluentAssertions;
|
||||
using SlpModularCms.Core.Availability;
|
||||
|
||||
namespace SlpModularCms.Core.Tests.Availability;
|
||||
|
||||
public class MasterUrlRulesTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("https://master.example.com")]
|
||||
[InlineData("https://master.example.com/")]
|
||||
[InlineData("http://localhost:7221")]
|
||||
[InlineData(" https://master.example.com ")]
|
||||
public void AnAbsoluteHttpOrHttpsAddress_IsValid(string url) => MasterUrlRules.IsValid(url).Should().BeTrue();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
[InlineData("<public-url-of-this-master-instance>")]
|
||||
[InlineData("master.example.com")]
|
||||
[InlineData("/relative/path")]
|
||||
[InlineData("ftp://master.example.com")]
|
||||
[InlineData("javascript:alert(1)")]
|
||||
[InlineData("https://user:pw@master.example.com")]
|
||||
[InlineData("https://master.example.com/?x=1")]
|
||||
[InlineData("https://master.example.com/#frag")]
|
||||
public void Everything_Else_IsNot(string? url) => MasterUrlRules.IsValid(url).Should().BeFalse();
|
||||
}
|
||||
Reference in New Issue
Block a user