Skip to content

Commit

Permalink
update ApiClarity PDK
Browse files Browse the repository at this point in the history
  • Loading branch information
pkalum committed Nov 28, 2023
1 parent 410e997 commit 1281955
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/gateway/kong/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (

"github.com/Kong/go-pdk"
"github.com/Kong/go-pdk/server"
"github.com/go-openapi/strfmt"

"github.com/openclarity/apiclarity/plugins/api/client/models"
"github.com/openclarity/apiclarity/plugins/common"
"github.com/openclarity/apiclarity/plugins/common/apiclarity_client"
Expand Down Expand Up @@ -195,7 +193,7 @@ func createTelemetry(kong *pdk.PDK) (*models.Telemetry, error) {
}
if len(reqBody) > MaxBodySize {
_ = kong.Log.Info("Request body is too long, ignoring")
reqBody = ""
reqBody = []byte("")
truncatedBodyReq = true
}
resBody, err := kong.ServiceResponse.GetRawBody()
Expand Down Expand Up @@ -268,7 +266,7 @@ func createTelemetry(kong *pdk.PDK) (*models.Telemetry, error) {
}

func getRequestTimeFromContext(kong *pdk.PDK) (int64, error) {
requestTime, err := kong.Ctx.GetSharedInt(common.RequestTimeContextKey)
requestTime, err := kong.Ctx.GetSharedFloat(common.RequestTimeContextKey)
if err != nil {
return 0, fmt.Errorf("failed to get request time from shared context: %v", err)
}
Expand Down

0 comments on commit 1281955

Please sign in to comment.