Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
comms
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xx network
comms
Commits
11f1f406
Commit
11f1f406
authored
Jan 4, 2023
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Disable cors for isonline
parent
3cf0b9df
No related branches found
No related tags found
2 merge requests
!61
Hotfix/fix is online
,
!39
Merge release into master
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
connect/connection_test.go
+9
-0
9 additions, 0 deletions
connect/connection_test.go
connect/webConn.go
+1
-1
1 addition, 1 deletion
connect/webConn.go
with
10 additions
and
1 deletion
connect/connection_test.go
+
9
−
0
View file @
11f1f406
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
connect/webConn.go
+
1
−
1
View file @
11f1f406
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment