Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upquarkus.http.cors.origins=* should be supported #5422
Comments
This comment has been minimized.
This comment has been minimized.
|
@Postremus so what happens when you do not set the origins property at all ? |
This comment has been minimized.
This comment has been minimized.
|
@sberyozkin When I do not set the origins property at all, I can access my resources from any origin. This is also the behavior I would expect from setting origin to "*". |
This comment has been minimized.
This comment has been minimized.
|
@Postremus I'm not sure why it was not supported from the start but it is really not a bug, and it is documented that leaving this property is equivalent to supporting all the origins which also implies less configuration. |
This comment has been minimized.
This comment has been minimized.
|
@sberyozkin I will try to create one this evening (CET). |
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Also, fix documentation. All configuration values are optional. The default of the origins config property is now "*". Tests are also updated. For example, no whitespace is allowed in quarkus.http.cors.methods. No string.trim() is done on this list, and it is directly passed to the enum method HttpMethods.valueOf(). fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Tests are also updated. For example, no whitespace is allowed in quarkus.http.cors.methods. No string.trim() is done on this list, and it is directly passed to the enum method HttpMethods.valueOf(). fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Fix naming of one of the test classes. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Fix naming of one of the test classes. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
…he service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
The star wildcard for the origins means, that any origin can access the service. Previosly, this behavior could only be achieved by leaving the config property out completly. Now you can either not set the origins config property, or use "*". Adjust the documentation for * origins. Add test case for this. fixes quarkusio#5422
Describe the bug
When I read the documentation about configuring cors for the first time, I tought that leaving "quarkus.http.cors.origins" as empty would be the same as "Access-Control-Allow-Origin: *".
The * wildcard allows any origin to access ressources.
Furthermore, a value of "*" is currently not supported. See CORSFilter.java#L93.
boolean allowsOrigin = corsConfig.origins.isEmpty() || corsConfig.origins.contains(origin);We should try to improve the documentation to reflect what is actually going on in the filter.
Expected behavior
If I use "" as wildcard, I expect quarkus to allow any origin to access my resources.
If I remove "quarkus.http.cors.origins" in my configuration, I expect quarkus to use "" as default.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
Actual behavior
Requests get rejected, altough quarkus.http.cors.origins is set to "*".
Configuration
Environment (please complete the following information):
uname -aorver:SYS_NT-10.0 DESKTOP-0TKUM9I 2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys
java -version:java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)