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

Add more CORS regex tests and fix the CORS regex example #34829

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

sberyozkin
Copy link
Member

Fixes #34718.

This PR adds few more tests using the regex documented in the docs.

Note, the same regex requires different treatment when using it directly from Java (\\. to represent a dot char) but \\\\. if the same regex is supplied from the properties.

I've proposed some text suggesting why it is the case, please tune it as required.
CC @gsmet @dmlloyd @radcortez and everyone else is welcome to comment :-)

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

🙈 The PR is closed and the preview is expired.


[NOTE]
====
If you use regular expressions, make sure 4 backward slashes are used to represent `.` and other metadata regular expression characters as normal characters, for example, `\\\\.` represents a `.` character while `\\.` represents a metadata regex character allowing for any character.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "if you use regular expressions in an application.properties file"?

@sberyozkin sberyozkin marked this pull request as ready for review July 19, 2023 09:40
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 19, 2023

Failing Jobs - Building 8d9a5b0

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 17 Build Failures Logs Raw logs
✔️ JVM Tests - JDK 19

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 17 #

- Failing: extensions/opentelemetry/deployment 
! Skipped: extensions/micrometer-registry-prometheus/deployment extensions/micrometer/deployment extensions/quartz/deployment and 32 more

📦 extensions/opentelemetry/deployment

io.quarkus.opentelemetry.deployment.instrumentation.VertxOpenTelemetryTest. - More details - Source on GitHub

java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:705)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$12(ClassBasedTestDescriptor.java:395)

@sberyozkin
Copy link
Member Author

Test failure is unrelated, this PR only adds another CORS regex test, and updates the docs

@sberyozkin sberyozkin merged commit f8ef115 into quarkusio:main Jul 19, 2023
58 of 61 checks passed
@sberyozkin sberyozkin deleted the fix_cors_regex_doc_example branch July 19, 2023 22:36
@quarkus-bot quarkus-bot bot added this to the 3.3 - main milestone Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CORS regex allowing more origins than expected
2 participants