蛋蛋星球-客户端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
433 B

  1. package aes
  2. import (
  3. "bytes"
  4. "fmt"
  5. "io/ioutil"
  6. "net/http"
  7. )
  8. func CheckBody(request *http.Request, key string) {
  9. body, _ := ioutil.ReadAll(request.Body)
  10. if string(body) != "" {
  11. fmt.Println("check_", string(body))
  12. str, _ := AesDecryptByECB(key, string(body))
  13. if str != "" {
  14. request.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(str)))
  15. }
  16. }
  17. return
  18. }
  19. func CheckError(err error) {
  20. if err != nil {
  21. panic(err)
  22. }
  23. }