|
- package aes
-
- import (
- "bytes"
- "fmt"
- "io/ioutil"
- "net/http"
- )
-
- func CheckBody(request *http.Request, key string) {
- body, _ := ioutil.ReadAll(request.Body)
- if string(body) != "" {
- fmt.Println("check_", string(body))
- str, _ := AesDecryptByECB(key, string(body))
- if str != "" {
- request.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(str)))
- }
- }
- return
- }
-
- func CheckError(err error) {
- if err != nil {
- panic(err)
- }
- }
|