VMware Cloud Foundation

 View Only
  • 1.  How to configure CORS in Spring cloud gateway for VMware Tanzu?

    Posted Apr 25, 2022 09:47 AM

    Hi All,

    We want to configure CORS for one of the spring-boot bound app to gateway. we did following attempt but none of them worked.

    • Added CORS configuration at srping-boot app level, but it only work from app container not from gateway.
    • We updated our gateway successfully by running cf update-service gateway -c '{ "cors": { "allowed-origins": [ "*"], "allowed-methods":[ "GET", "OPTIONS"] }}'  but did not worked.
    • We also disabled the secure header in-case causing the issue by running cf update-service gateway -c '{ "disable-secure-headers": false }'.

    Could anyone please help us on this ?



  • 2.  RE: How to configure CORS in Spring cloud gateway for VMware Tanzu?

    Broadcom Employee
    Posted May 02, 2022 04:07 PM

    Perhaps you should use "allowed-origin-patterns: ["*"]" rather than "allowed-origins: ["*"]"

     



  • 3.  RE: How to configure CORS in Spring cloud gateway for VMware Tanzu?

    Posted Jun 17, 2022 01:06 PM

    Hi  

    It did not work. do we need to change some configuration before running this ?

    cf update-service gateway -c '{ "cors": { "allowed-origin-patterns": ["*"], "allowed-methods":[ "GET", "OPTIONS"] }}'
    Updating service instance gateway as -------...
    FAILED
    Server error, status code: 502, error code: 10001, message: Service broker error: Service broker parameters are invalid: #/cors: extraneous key [allowed-origin-patterns] is not permitted



  • 4.  RE: How to configure CORS in Spring cloud gateway for VMware Tanzu?

    Posted May 16, 2022 09:35 AM

    I have exactly the same issue. Anyone got a thought?

     

    epayitonline