Skip to content

Commit

Permalink
add Access-Control-Allow-Origin: * header
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmnetp committed Mar 8, 2015
1 parent 2b84ef0 commit aa8b461
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/imageproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/gregjones/httpcache"
"github.com/gregjones/httpcache/diskcache"
"github.com/peterbourgon/diskv"
"willnorris.com/go/imageproxy"
"github.com/bnmnetp/imageproxy"
)

// goxc values
Expand Down
3 changes: 2 additions & 1 deletion imageproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
copyHeader(w, resp, "Last-Modified")
copyHeader(w, resp, "Expires")
copyHeader(w, resp, "Etag")

w.Header().Set("Access-Control-Allow-Origin", "*")

if is304 := check304(r, resp); is304 {
w.WriteHeader(http.StatusNotModified)
return
Expand Down

0 comments on commit aa8b461

Please sign in to comment.