Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/apis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ async def validate(ctx, nxt: HttpMiddleware):
// Using the Go SDK we recommend using higher-order functions to define middleware
func validate(next apis.Handler) apis.Handler {
return func (ctx *apis.Ctx) error {
if ctx.Request.Headers()["content-type"] != nil {
if ctx.Request.Headers()["content-type"] == nil {
ctx.Response.Status = 400
ctx.Response.Body = []byte("header Content-Type is required")

Expand Down Expand Up @@ -721,7 +721,7 @@ import (

func validate(next apis.Handler) apis.Handler {
return func(ctx *apis.Ctx) error {
if ctx.Request.Headers()["content-type"] != nil {
if ctx.Request.Headers()["content-type"] == nil {
ctx.Response.Status = 400
ctx.Response.Body = []byte("header Content-Type is required")

Expand Down Expand Up @@ -795,7 +795,7 @@ import (

func validate(next apis.Handler) apis.Handler {
return func(ctx *apis.Ctx) error {
if ctx.Request.Headers()["content-type"] != nil {
if ctx.Request.Headers()["content-type"] == nil {
ctx.Response.Status = 400
ctx.Response.Body = []byte("header Content-Type is required")

Expand Down
Loading