Skip to content

Commit

Permalink
update Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kooksee committed Aug 15, 2024
1 parent c8443b1 commit 91d704e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions servers/grpcs/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package grpcs

import (
"fmt"
"strings"

"github.com/gofiber/fiber/v2"
"github.com/pubgo/lava/lava"
Expand Down Expand Up @@ -40,8 +41,10 @@ type httpRequest struct {
ctx *fiber.Ctx
}

func (r *httpRequest) Kind() string { return "http" }
func (r *httpRequest) Operation() string { return fmt.Sprintf("%s %s", r.ctx.Method(), r.ctx.Path()) }
func (r *httpRequest) Kind() string { return "http" }
func (r *httpRequest) Operation() string {
return fmt.Sprintf("%s %s", strings.TrimSpace(r.ctx.Method()), strings.TrimSpace(r.ctx.Path()))
}
func (r *httpRequest) Client() bool { return false }
func (r *httpRequest) Header() *lava.RequestHeader { return &r.ctx.Request().Header }
func (r *httpRequest) Payload() interface{} { return r.ctx.Body() }
Expand All @@ -51,5 +54,5 @@ func (r *httpRequest) ContentType() string {
}

func (r *httpRequest) Service() string { return r.ctx.OriginalURL() }
func (r *httpRequest) Endpoint() string { return r.ctx.OriginalURL() }
func (r *httpRequest) Endpoint() string { return string(r.ctx.Request().RequestURI()) }
func (r *httpRequest) Stream() bool { return false }

0 comments on commit 91d704e

Please sign in to comment.