Skip to content
Snippets Groups Projects
Commit 11f1f406 authored by Jonah Husson's avatar Jonah Husson
Browse files

Disable cors for isonline

parent 3cf0b9df
No related branches found
No related tags found
2 merge requests!61Hotfix/fix is online,!39Merge release into master
...@@ -194,6 +194,15 @@ func TestWebConnection_TLS(t *testing.T) { ...@@ -194,6 +194,15 @@ func TestWebConnection_TLS(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
_, ok := h.IsOnline()
if !ok {
t.Fatalf("host %s is not online", h.String())
}
_, ok = grpcHost.IsOnline()
if !ok {
t.Fatalf("host %s is not online", grpcHost.String())
}
ctx, cancel := grpcHost.GetMessagingContext() ctx, cancel := grpcHost.GetMessagingContext()
resp := &pb.Ack{} resp := &pb.Ack{}
err = grpcHost.connection.GetGrpcConn().Invoke(ctx, "/messages.Generic/AuthenticateToken", &pb.AuthenticatedMessage{}, resp) err = grpcHost.connection.GetGrpcConn().Invoke(ctx, "/messages.Generic/AuthenticateToken", &pb.AuthenticatedMessage{}, resp)
......
...@@ -219,7 +219,7 @@ func (wc *webConn) IsOnline() (time.Duration, bool) { ...@@ -219,7 +219,7 @@ func (wc *webConn) IsOnline() (time.Duration, bool) {
} }
// IMPORTANT - enables better HTTP(S) discovery, because many browsers block CORS by default. // IMPORTANT - enables better HTTP(S) discovery, because many browsers block CORS by default.
//req.Header.Add("js.fetch:mode", "no-cors") req.Header.Add("js.fetch:mode", "no-cors")
jww.TRACE.Printf("(GO request): %+v", req) jww.TRACE.Printf("(GO request): %+v", req)
req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace)) req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment