Skip to content

Commit

Permalink
cors README.md code example (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregwebs authored Oct 25, 2023
1 parent 32d0826 commit e8b11b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ var _ = Service("calc", func() {

// Sets CORS response headers for requests with Origin header matching strings ending with ".domain.com" (e.g. "my.domain.com")
cors.Origin("*.domain.com", func() {
Headers("X-Shared-Secret", "X-Api-Version")
MaxAge(100)
Credentials()
cors.Headers("X-Shared-Secret", "X-Api-Version")
cors.MaxAge(100)
cors.Credentials()
})

// Sets CORS response headers for requests with any Origin header
cors.Origin("*")

// Sets CORS response headers for requests with Origin header matching the regular expression ".*domain.*"
cors.Origin("/.*domain.*/", func() {
Headers("*")
Methods("GET", "POST")
Expose("X-Time")
cors.Headers("*")
cors.Methods("GET", "POST")
cors.Expose("X-Time")
})
})
```
Expand Down

0 comments on commit e8b11b4

Please sign in to comment.