We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent92db437 commitc00931aCopy full SHA for c00931a
enterprise/coderd/identityprovider/middleware.go
@@ -16,10 +16,11 @@ func authorizeMW(accessURL *url.URL) func(next http.Handler) http.Handler {
16
returnfunc(next http.Handler) http.Handler {
17
returnhttp.HandlerFunc(func(rw http.ResponseWriter,r*http.Request) {
18
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.
22
originU,err:=url.Parse(origin)
-iferr!=nil {
-// TODO: Curl requests will not have this. One idea is to always show
-// html here??
23
+iferr!=nil||origin=="" {
24
httpapi.Write(r.Context(),rw,http.StatusBadRequest, codersdk.Response{
25
Message:"Invalid or missing origin header.",
26
Detail:err.Error(),