Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unsupported external DTD and schema properties #931

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

mholthausen
Copy link
Member

Description

This MR addresses an issue where the DocumentBuilderFactory would throw an IllegalArgumentException when trying to set XMLConstants.ACCESS_EXTERNAL_DTD and XMLConstants.ACCESS_EXTERNAL_SCHEMA properties if the underlying XML parser does not support them.

Now, the setting of external DTD and schema access properties is wrapped in a try-catch block to handle unsupported cases gracefully. The current implementation was causing a crash when the parser did not recognize the properties related to external DTD and schema access.

@terrestris/devs please review

Pull request type

  • Bugfix
  • Feature
  • Dependency updates
  • Tests
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe)

Do you introduce a breaking change?

  • Yes
  • No

Checklist

  • I understand and agree that the changes in this PR will be licensed under the
    Apache Licence Version 2.0.
  • I have followed the guidelines for contributing.
  • The proposed change fits to the content of the code of conduct.
  • I have added or updated tests and documentation, and the test suite passes (run mvn test locally).
  • I have added a screenshot/screencast to illustrate the visual output of my update.

@mholthausen mholthausen changed the title fix: handle unsupported external DTD and schema properties Handle unsupported external DTD and schema properties Oct 11, 2024
@mholthausen mholthausen merged commit b85f1b1 into main Oct 11, 2024
4 checks passed
Copy link
Contributor

🎉 This PR is included in version 21.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants