Skip to content

Commit

Permalink
debug : content type
Browse files Browse the repository at this point in the history
  • Loading branch information
hxms committed Jan 21, 2024
1 parent b7eb3d4 commit e2c49c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/handler/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rpc

import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -102,11 +103,15 @@ func (h *rpcHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

ct := r.Header.Get("Content-Type")

fmt.Println("Content-Type: ", ct)

// Strip charset from Content-Type (like `application/json; charset=UTF-8`)
if idx := strings.IndexRune(ct, ';'); idx >= 0 {
ct = ct[:idx]
}

fmt.Println("Content-Type: ", ct)

// micro client
c := h.opts.Client

Expand Down

0 comments on commit e2c49c5

Please sign in to comment.