Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc00931a

Browse files
committed
Comment on blank origin
1 parent92db437 commitc00931a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎enterprise/coderd/identityprovider/middleware.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ func authorizeMW(accessURL *url.URL) func(next http.Handler) http.Handler {
1616
returnfunc(next http.Handler) http.Handler {
1717
returnhttp.HandlerFunc(func(rw http.ResponseWriter,r*http.Request) {
1818
origin:=r.Header.Get(httpmw.OriginHeader)
19+
// TODO: The origin can be blank from some clients, like cURL. For now
20+
// only browser-based auth flow is officially supported but in a future PR
21+
// we should support a cURL-based and blank origin flows.
1922
originU,err:=url.Parse(origin)
20-
iferr!=nil {
21-
// TODO: Curl requests will not have this. One idea is to always show
22-
// html here??
23+
iferr!=nil||origin=="" {
2324
httpapi.Write(r.Context(),rw,http.StatusBadRequest, codersdk.Response{
2425
Message:"Invalid or missing origin header.",
2526
Detail:err.Error(),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp