Skip to content

[Bug] tripple-rest global CORS not support #14779

@stdiogo

Description

@stdiogo

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.3.0, OpenJDK17 , Windows 10

Steps to reproduce this issue

https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/protocol/tripe-rest-manual/#cors%E9%85%8D%E7%BD%AE-2

According to the configuration mentioned in the documentation above

image
allowed-origins、allowed-methods field in org.apache.dubbo.config.nested.CorsConfig Which are java type of String[] do not take effect, so the dubbo service can not get the corresponding CorsConfig value. But allow-credentials、max-age can take effect。

I reviewed the code of org.apache.dubbo.config.AbstractConfig(the red rectangle),none of condition can match. So no value will return when class field type is String[] .
image

Even fix problem above, I think it is not work. Http1UnaryServerChannelObserver rebuild the metadata(Header),so whatever the header is set in Filter, are not send to client.
image

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions