Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13046

CORS global configuration support in XML namespace

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 4.2 RC2
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Issue Links

        Activity

        Hide
        sdeleuze Sébastien Deleuze added a comment - - edited

        It is now possible to configure CORS thanks to the XML mvc namespace:

        	<mvc:cors>
        		<mvc:mapping path="/api/**"
        					allowed-origins="http://domain1.com, http://domain2.com"
        					allowed-methods="GET, PUT"
        					allowed-headers="header1, header2, header3"
        					exposed-headers="header1, header2" allow-credentials="false"
        					max-age="123" />
        		<mvc:mapping path="/resources/**" allowed-origins="http://domain1.com" />
        	</mvc:cors>

        This minimal configuration handle CORS request on /** path pattern:

        	<mvc:cors />

        Show
        sdeleuze Sébastien Deleuze added a comment - - edited It is now possible to configure CORS thanks to the XML mvc namespace: < mvc :cors> < mvc :mapping path = "/api/**" allowed-origins = "http://domain1.com, http://domain2.com" allowed-methods = "GET, PUT" allowed-headers = "header1, header2, header3" exposed-headers = "header1, header2" allow-credentials = "false" max-age = "123" /> < mvc :mapping path = "/resources/**" allowed-origins = "http://domain1.com" /> </ mvc :cors> This minimal configuration handle CORS request on /** path pattern: < mvc :cors />

          People

          • Assignee:
            sdeleuze Sébastien Deleuze
            Reporter:
            sdeleuze Sébastien Deleuze
            Last updater:
            Stéphane Nicoll
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 16 weeks, 4 days ago