mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-13 01:57:13 +02:00
chore(runner): add runner uuid in http header.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"gitea.com/gitea/act_runner/core"
|
||||
"gitea.com/gitea/proto-go/ping/v1/pingv1connect"
|
||||
"gitea.com/gitea/proto-go/runner/v1/runnerv1connect"
|
||||
|
||||
@ -26,7 +27,7 @@ func New(endpoint, secret string, opts ...Option) *HTTPClient {
|
||||
|
||||
interceptor := connect.UnaryInterceptorFunc(func(next connect.UnaryFunc) connect.UnaryFunc {
|
||||
return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {
|
||||
req.Header().Set("X-Runner-Token", secret)
|
||||
req.Header().Set(core.UUIDHeader, secret)
|
||||
return next(ctx, req)
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user