Skip to content

Commit

Permalink
Merge 36cf101 into ea74613
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhowes committed Mar 26, 2017
2 parents ea74613 + 36cf101 commit 1f854c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 8 additions & 7 deletions Makefile
Expand Up @@ -91,10 +91,10 @@ start-docker:
fi

@if [ $(shell docker ps -a | grep -ci mattermost-webrtc) -eq 0 ]; then \
echo starting mattermost-webrtc; \
echo starting mattermost-webrtc; \
docker run --name mattermost-webrtc -p 7088:7088 -p 7089:7089 -p 8188:8188 -p 8189:8189 -d mattermost/webrtc:latest > /dev/null; \
elif [ $(shell docker ps | grep -ci mattermost-webrtc) -eq 0 ]; then \
echo restarting mattermost-webrtc; \
echo restarting mattermost-webrtc; \
docker start mattermost-webrtc > /dev/null; \
fi

Expand Down Expand Up @@ -198,13 +198,14 @@ check-client-style:

check-server-style: govet
@echo Running GOFMT
$(eval GOFMT_OUTPUT := $(shell gofmt -d -s api/ model/ store/ utils/ manualtesting/ einterfaces/ cmd/platform/ 2>&1))
@echo "$(GOFMT_OUTPUT)"
@if [ ! "$(GOFMT_OUTPUT)" ]; then \
echo "gofmt success"; \
else \
@gofmt -d -s api/ model/ store/ utils/ manualtesting/ einterfaces/ cmd/platform/ 2>&1 > gofmt_output.log
@if test -s gofmt_output.log; then \
cat gofmt_output.log; \
echo "gofmt failure"; \
exit 1; \
else \
echo "gofmt success"; \
rm gofmt_output.log; \
fi

check-style: check-client-style check-server-style
Expand Down
5 changes: 4 additions & 1 deletion api/websocket_test.go
Expand Up @@ -319,6 +319,10 @@ func TestWebsocketOriginSecurity(t *testing.T) {

url := "ws://localhost" + utils.Cfg.ServiceSettings.ListenAddress

defer func() {
*utils.Cfg.ServiceSettings.AllowCorsFrom = ""
}()

// Should fail because origin doesn't match
_, _, err := websocket.DefaultDialer.Dial(url+model.API_URL_SUFFIX_V3+"/users/websocket", http.Header{
"Origin": []string{"http://www.evil.com"},
Expand Down Expand Up @@ -362,7 +366,6 @@ func TestWebsocketOriginSecurity(t *testing.T) {
t.Fatal("Should have errored because Origin contain AllowCorsFrom")
}

*utils.Cfg.ServiceSettings.AllowCorsFrom = ""
}

func TestZZWebSocketTearDown(t *testing.T) {
Expand Down

0 comments on commit 1f854c7

Please sign in to comment.