Skip to content

Commit

Permalink
Merge pull request #7 from deadcheat/feature/fix-issue-5_app_crashes_…
Browse files Browse the repository at this point in the history
…when_accessing_multiple_endpoints

remove debug line
  • Loading branch information
deadcheat committed Sep 14, 2018
2 parents faff0aa + 513b112 commit a0216ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
5 changes: 0 additions & 5 deletions glide.yaml
Expand Up @@ -2,8 +2,3 @@ package: github.com/deadcheat/goacors
import:
- package: github.com/goadesign/goa
version: ^1.3.1
testImport:
- package: github.com/onsi/ginkgo
version: ^1.5.0
- package: github.com/onsi/gomega
version: ^1.4.0
6 changes: 1 addition & 5 deletions matcher.go
Expand Up @@ -2,7 +2,6 @@ package goacors

import (
"context"
"fmt"
"net/url"
"strings"

Expand All @@ -24,9 +23,8 @@ func newStrictOriginMatcher(config *GoaCORSConfig) OriginMatcher {
return &StrictOriginMatcher{config}
}

// Filter check if allowedOrigins contain * or completely same origin
// FindMatchedOrigin check if allowedOrigins contain * or completely same origin
func (s *StrictOriginMatcher) FindMatchedOrigin(allowedOrigins []string, origin string) (foundOne string, found bool) {
fmt.Println("fuga", allowedOrigins, origin)
for _, o := range allowedOrigins {
if foundOne, found = innerMatcher(o, origin, s.config.AllowCredentials); found {
return
Expand Down Expand Up @@ -73,12 +71,10 @@ func (i *InterMediateMatcher) FindMatchedOrigin(allowedOrigins []string, origin
if err != nil {
return "", false
}

for _, o := range allowedOrigins {
if foundOne, found = i.baseMatcher(o, origin, i.config.AllowCredentials); found {
return
}

allowedURL, err := url.Parse(o)
if err != nil {
panic(err)
Expand Down

0 comments on commit a0216ac

Please sign in to comment.