zbchi opened a new issue, #3089:
URL: https://github.com/apache/dubbo-go/issues/3089

   ### ⚠️ Verification
   
   - [x] I have searched the 
[issues](https://github.com/apache/dubbo-go/issues) of this repository and 
believe that this is not a duplicate.
   - [x] I have searched the [release 
notes](https://github.com/apache/dubbo-go/releases) of this repository and 
believe that this is not a duplicate.
   
   ### 🎯 Solution Description
   
   Problem Statement 
   When a browser initiates a cross-origin request, it first sends a preflight 
request (OPTIONS).The current Handler does not process the OPTIONS method, 
resulting in a 405 Method Not Allowed response. This prevents Web clients from 
interacting directly with Triple services.
   
   Proposed Solution 
   Natively support CORS at the Triple Protocol layer, allowing users to handle 
cross-origin requests by configuring an allowed origin whitelist.
   
   ### 📋 Use Cases
   
   ```go
   protocol.WithTriple(
       triple.WithCORS(
           
triple.CORSAllowOrigins("[https://example.com](https://example.com)", 
"https://*.sub.example.com";),
           triple.CORSAllowMethods("POST", "GET", "OPTIONS"),
           triple.CORSAllowHeaders("Content-Type", "Authorization"),
           triple.CORSExposeHeaders("X-Custom-Header"),
           triple.CORSAllowCredentials(true),
           triple.CORSMaxAge(3600),
       ),
   )
   ```
   
   ### ⚖️ Complexity & Risks
   
   _No response_
   
   ### 🔗 External Dependencies
   
   _No response_
   
   ### 📘 Additional Context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to