Skip to content

Commit eed37c2

Browse files
committed
Define public_baseurl for Dendrite and manual homeservers (#1011)
1 parent 9c8791d commit eed37c2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/SyTest/Homeserver/Dendrite.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ sub unsecure_port
330330
return $self->{ports}{monolith_unsecure};
331331
}
332332

333+
sub public_baseurl
334+
{
335+
my $self = shift;
336+
# run-tests.pl defines whether TLS should be used or not.
337+
my ( $want_tls ) = @_;
338+
return $want_tls ?
339+
"https://$self->{bind_host}:" . $self->secure_port() :
340+
"http://$self->{bind_host}:" . $self->unsecure_port();
341+
}
342+
333343
sub start
334344
{
335345
my $self = shift;

lib/SyTest/Homeserver/Manual.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ sub unsecure_port
7878
return $self->{unsecure_port};
7979
}
8080

81+
sub public_baseurl
82+
{
83+
my $self = shift;
84+
# run-tests.pl defines whether TLS should be used or not.
85+
my ( $want_tls ) = @_;
86+
return $want_tls ?
87+
"https://$self->{bind_host}:" . $self->secure_port() :
88+
"http://$self->{bind_host}:" . $self->unsecure_port();
89+
}
90+
8191
sub start
8292
{
8393
my $self = shift;

0 commit comments

Comments
 (0)