Skip to content

Commit f55fa0c

Browse files
committed
HHH-16892 Fix LocalXmlResourceResolver not resolving some dtd URLs that use the https scheme
1 parent 5201a45 commit f55fa0c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalXmlResourceResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ public String getIdentifierBase() {
259259
public boolean matches(String publicId, String systemId) {
260260
if ( publicId != null ) {
261261
if ( publicId.startsWith( httpBase )
262-
|| publicId.matches( httpsBase ) ) {
262+
|| publicId.startsWith( httpsBase ) ) {
263263
return true;
264264
}
265265
}
266266

267267
if ( systemId != null ) {
268268
if ( systemId.startsWith( httpBase )
269-
|| systemId.matches( httpsBase ) ) {
269+
|| systemId.startsWith( httpsBase ) ) {
270270
return true;
271271
}
272272
}

hibernate-core/src/test/java/org/hibernate/boot/jaxb/internal/stax/LocalXmlResourceResolverTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ void resolve_namespace_localResource(String namespace, String expectedLocalResou
7272
"https://hibernate.org/dtd/hibernate-configuration,org/hibernate/hibernate-configuration-3.0.dtd",
7373

7474
"http://hibernate.sourceforge.net/hibernate-configuration,org/hibernate/hibernate-configuration-3.0.dtd",
75-
"https://hibernate.sourceforge.net/hibernate-configuration,org/hibernate/hibernate-configuration-3.0.dtd"
75+
"https://hibernate.sourceforge.net/hibernate-configuration,org/hibernate/hibernate-configuration-3.0.dtd",
76+
77+
"http://hibernate.org/dtd/hibernate-mapping-3.0.dtd,org/hibernate/hibernate-mapping-3.0.dtd",
78+
"https://hibernate.org/dtd/hibernate-mapping-3.0.dtd,org/hibernate/hibernate-mapping-3.0.dtd"
7679
})
7780
void resolve_dtd_localResource(String id, String expectedLocalResource) throws XMLStreamException {
7881
// publicId

0 commit comments

Comments
 (0)