Skip to content

Commit

Permalink
Merge pull request #224 from MartijnVdS/xmllang
Browse files Browse the repository at this point in the history
Include `xml:lang` attribute in ServiceName and ServiceDescription
  • Loading branch information
timlegge authored May 21, 2024
2 parents 9e84760 + aefae65 commit 0fc0914
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Net/SAML2/AttributeConsumingService.pm
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ sub to_xml {
index => $self->index,
isDefault => $self->default ? 'true' : 'false',
},
$xml->ServiceName($self->namespace, undef, $self->service_name),
$self->_has_service_description ? $xml->ServiceDescription($self->namespace, undef, $self->service_description) : (),
$xml->ServiceName($self->namespace, { 'xml:lang' => 'en' }, $self->service_name),
$self->_has_service_description ? $xml->ServiceDescription($self->namespace, { 'xml:lang' => 'en' }, $self->service_description) : (),
map { $_->to_xml } @{ $self->attributes },
);
}
Expand Down
2 changes: 2 additions & 0 deletions t/02-create-sp.t
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
'Net::SAML2 testsuite',
".. with the correct value"
);
is($child[0]->getAttribute("xml:lang"),
"en", ".. and xml:lang is set");

is($child[1]->nodeName, "md:RequestedAttribute",
"Requested attribute found");
Expand Down
5 changes: 5 additions & 0 deletions t/28-attribute-consuming-service.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ is(
"Net::SAML2 testsuite",
".. and has the correct content"
);
is(
$node->getAttribute('xml:lang'),
"en",
".. and has the correct xml:lang"
);

$node = get_single_node_ok($xpath,
'/md:AttributeConsumingService/md:RequestedAttribute');
Expand Down

0 comments on commit 0fc0914

Please sign in to comment.