From db6dee241fe84354b920d426412fc40ed0d7c18f Mon Sep 17 00:00:00 2001 From: Lukas Jenicek Date: Mon, 7 Oct 2024 10:27:47 +0200 Subject: [PATCH] use header name const --- _examples/golang-basics/example.gen.go | 4 ++-- _examples/golang-imports/api.gen.go | 4 ++-- client.go.tmpl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_examples/golang-basics/example.gen.go b/_examples/golang-basics/example.gen.go index 68a5a0a..f4580f5 100644 --- a/_examples/golang-basics/example.gen.go +++ b/_examples/golang-basics/example.gen.go @@ -357,7 +357,7 @@ func (s *exampleServiceServer) ServeHTTP(w http.ResponseWriter, r *http.Request) } }() - w.Header().Set("Webrpc", WebRPCHeader()) + w.Header().Set(WebRPCVersionHeader, WebRPCHeader()) ctx := r.Context() ctx = context.WithValue(ctx, HTTPResponseWriterCtxKey, w) @@ -799,7 +799,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Webrpc", WebRPCHeader()) + req.Header.Set(WebRPCVersionHeader, WebRPCHeader()) if headers, ok := HTTPRequestHeaders(ctx); ok { for k := range headers { for _, v := range headers[k] { diff --git a/_examples/golang-imports/api.gen.go b/_examples/golang-imports/api.gen.go index 821488a..60d7d3b 100644 --- a/_examples/golang-imports/api.gen.go +++ b/_examples/golang-imports/api.gen.go @@ -249,7 +249,7 @@ func (s *exampleAPIServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } }() - w.Header().Set("Webrpc", WebRPCHeader()) + w.Header().Set(WebRPCVersionHeader, WebRPCHeader()) ctx := r.Context() ctx = context.WithValue(ctx, HTTPResponseWriterCtxKey, w) @@ -517,7 +517,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Webrpc", WebRPCHeader()) + req.Header.Set(WebRPCVersionHeader, WebRPCHeader()) if headers, ok := HTTPRequestHeaders(ctx); ok { for k := range headers { for _, v := range headers[k] { diff --git a/client.go.tmpl b/client.go.tmpl index 39eff09..83dba8f 100644 --- a/client.go.tmpl +++ b/client.go.tmpl @@ -208,7 +208,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set("Webrpc", WebRPCHeader()) + req.Header.Set(WebRPCVersionHeader, WebRPCHeader()) if headers, ok := HTTPRequestHeaders(ctx); ok { for k := range headers { for _, v := range headers[k] {