qustavo / httplab

The interactive web server
MIT License
4.04k stars 122 forks source link

CORS support #40

Closed qustavo closed 7 years ago

qustavo commented 7 years ago

@spemberton this should solve the CORS issue #39. I'd love you to review it. Thanks in advance!

qustavo commented 7 years ago

ping @spemberton

spemberton commented 7 years ago

I hope to be able to review it this week. On another project right now.

qustavo commented 7 years ago

Thanks @spemberton !

spemberton commented 7 years ago

Never used go before, so I need help on how to compile/run this version.

qustavo commented 7 years ago

ok, after installing go type:

mkdir -p go/src/github.com/gchaincl && cd $_
git clone https://github.com/gchaincl/httplab.git
cd httplab
git checkout cors
go get ./...
go run ./cmd/httplab/main.go
spemberton commented 7 years ago

And what should GOPATH be set to?

On Mon, 24 Jul 2017 21:12:44 +0200, Gustavo Chaín
notifications@github.com wrote:

ok, after installing go type: mkdir -p go/src/github.com/gchaincl && cd $_ git clone https://github.com/gchaincl/httplab.git cd httplab git checkout cors go get ./... go run ./cmd/httplab/main.go

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

qustavo commented 7 years ago

export GOPATH=$HOME/go

qustavo commented 7 years ago

but I think if you're running go 1.8.x, $HOME/go is assumed

spemberton commented 7 years ago

$ go get ./... go install: no install location for directory
/home/steven/Downloads/httplab-cors outside GOPATH

On Wed, 26 Jul 2017 12:42:21 +0200, Gustavo Chaín
notifications@github.com wrote:

but I think if you're running go 1.8/x, $HOME/go is assumed

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

qustavo commented 7 years ago

well, your repo (httplab-cors) should live inside $GOPATH/src/github.com/gchaincl Check the instructions above

spemberton commented 7 years ago

OK, worked like a charm! The only thing I would ask is that you keep the CORS requests and responses in the Request History, so that you can page through them to check what happened. Otherwise, perfect! Thanks, great work!

qustavo commented 7 years ago

Great, let's do this, I'm merging this so we have something useful, then you can open a new issue with your request, I'll try to implement it for the next release