|
|
@@ -19,12 +19,13 @@ import (
|
|
|
"fmt"
|
|
|
"net/http"
|
|
|
"net/url"
|
|
|
+ "sort"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
|
type CORSInfo map[string]bool
|
|
|
|
|
|
-// CORSInfo implements the flag.Value interface to allow users to define a list of CORS origins
|
|
|
+// Set implements the flag.Value interface to allow users to define a list of CORS origins
|
|
|
func (ci *CORSInfo) Set(s string) error {
|
|
|
m := make(map[string]bool)
|
|
|
for _, v := range strings.Split(s, ",") {
|
|
|
@@ -49,6 +50,7 @@ func (ci *CORSInfo) String() string {
|
|
|
for k := range *ci {
|
|
|
o = append(o, k)
|
|
|
}
|
|
|
+ sort.StringSlice(o).Sort()
|
|
|
return strings.Join(o, ",")
|
|
|
}
|
|
|
|