Do not decode JSON from body if no POST params are spec.

This commit is contained in:
Denis Arh
2021-03-12 14:50:40 +01:00
parent 186b6cb99e
commit 82c76bbe6c
37 changed files with 214 additions and 1261 deletions
+4 -50
View File
@@ -25,6 +25,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -278,16 +282,6 @@ func (r AttachmentList) GetPageCursor() string {
// Fill processes request and fills internal variables
func (r *AttachmentList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -407,16 +401,6 @@ func (r AttachmentRead) GetUserID() uint64 {
// Fill processes request and fills internal variables
func (r *AttachmentRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -506,16 +490,6 @@ func (r AttachmentDelete) GetUserID() uint64 {
// Fill processes request and fills internal variables
func (r *AttachmentDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -617,16 +591,6 @@ func (r AttachmentOriginal) GetDownload() bool {
// Fill processes request and fills internal variables
func (r *AttachmentOriginal) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -734,16 +698,6 @@ func (r AttachmentPreview) GetUserID() uint64 {
// Fill processes request and fills internal variables
func (r *AttachmentPreview) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
+5 -20
View File
@@ -25,6 +25,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -135,16 +139,6 @@ func (r AutomationList) GetExcludeServerScripts() bool {
// Fill processes request and fills internal variables
func (r *AutomationList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -237,16 +231,6 @@ func (r AutomationBundle) GetExt() string {
// Fill processes request and fills internal variables
func (r *AutomationBundle) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -294,6 +278,7 @@ func (r AutomationTriggerScript) GetScript() string {
// Fill processes request and fills internal variables
func (r *AutomationTriggerScript) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
+6 -30
View File
@@ -28,6 +28,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -213,16 +217,6 @@ func (r ChartList) GetSort() string {
// Fill processes request and fills internal variables
func (r *ChartList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -329,6 +323,7 @@ func (r ChartCreate) GetLabels() map[string]string {
// Fill processes request and fills internal variables
func (r *ChartCreate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -421,16 +416,6 @@ func (r ChartRead) GetChartID() uint64 {
// Fill processes request and fills internal variables
func (r *ChartRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -508,6 +493,7 @@ func (r ChartUpdate) GetUpdatedAt() *time.Time {
// Fill processes request and fills internal variables
func (r *ChartUpdate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -613,16 +599,6 @@ func (r ChartDelete) GetChartID() uint64 {
// Fill processes request and fills internal variables
func (r *ChartDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
+7 -30
View File
@@ -29,6 +29,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -252,16 +256,6 @@ func (r ModuleList) GetSort() string {
// Fill processes request and fills internal variables
func (r *ModuleList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -380,6 +374,7 @@ func (r ModuleCreate) GetLabels() map[string]string {
// Fill processes request and fills internal variables
func (r *ModuleCreate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -479,16 +474,6 @@ func (r ModuleRead) GetModuleID() uint64 {
// Fill processes request and fills internal variables
func (r *ModuleRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -572,6 +557,7 @@ func (r ModuleUpdate) GetLabels() map[string]string {
// Fill processes request and fills internal variables
func (r *ModuleUpdate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -684,16 +670,6 @@ func (r ModuleDelete) GetModuleID() uint64 {
// Fill processes request and fills internal variables
func (r *ModuleDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -747,6 +723,7 @@ func (r ModuleTriggerScript) GetScript() string {
// Fill processes request and fills internal variables
func (r *ModuleTriggerScript) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
+8 -30
View File
@@ -28,6 +28,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -211,16 +215,6 @@ func (r NamespaceList) GetSort() string {
// Fill processes request and fills internal variables
func (r *NamespaceList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -315,6 +309,7 @@ func (r NamespaceCreate) GetMeta() sqlxTypes.JSONText {
// Fill processes request and fills internal variables
func (r *NamespaceCreate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -396,16 +391,6 @@ func (r NamespaceRead) GetNamespaceID() uint64 {
// Fill processes request and fills internal variables
func (r *NamespaceRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -477,6 +462,7 @@ func (r NamespaceUpdate) GetUpdatedAt() *time.Time {
// Fill processes request and fills internal variables
func (r *NamespaceUpdate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -577,16 +563,6 @@ func (r NamespaceDelete) GetNamespaceID() uint64 {
// Fill processes request and fills internal variables
func (r *NamespaceDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -622,6 +598,7 @@ func (r NamespaceUpload) GetUpload() *multipart.FileHeader {
// Fill processes request and fills internal variables
func (r *NamespaceUpload) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -674,6 +651,7 @@ func (r NamespaceTriggerScript) GetScript() string {
// Fill processes request and fills internal variables
func (r *NamespaceTriggerScript) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
+5
View File
@@ -26,6 +26,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -112,6 +116,7 @@ func (r NotificationEmailSend) GetRemoteAttachments() []string {
// Fill processes request and fills internal variables
func (r *NotificationEmailSend) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
+9 -40
View File
@@ -27,6 +27,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -326,16 +330,6 @@ func (r PageList) GetSort() string {
// Fill processes request and fills internal variables
func (r *PageList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -478,6 +472,7 @@ func (r PageCreate) GetBlocks() sqlxTypes.JSONText {
// Fill processes request and fills internal variables
func (r *PageCreate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -605,16 +600,6 @@ func (r PageRead) GetPageID() uint64 {
// Fill processes request and fills internal variables
func (r *PageRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -656,16 +641,6 @@ func (r PageTree) GetNamespaceID() uint64 {
// Fill processes request and fills internal variables
func (r *PageTree) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -761,6 +736,7 @@ func (r PageUpdate) GetBlocks() sqlxTypes.JSONText {
// Fill processes request and fills internal variables
func (r *PageUpdate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -900,6 +876,7 @@ func (r PageReorder) GetPageIDs() []string {
// Fill processes request and fills internal variables
func (r *PageReorder) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -972,16 +949,6 @@ func (r PageDelete) GetPageID() uint64 {
// Fill processes request and fills internal variables
func (r *PageDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -1035,6 +1002,7 @@ func (r PageUpload) GetUpload() *multipart.FileHeader {
// Fill processes request and fills internal variables
func (r *PageUpload) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1111,6 +1079,7 @@ func (r PageTriggerScript) GetScript() string {
// Fill processes request and fills internal variables
func (r *PageTriggerScript) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
+5 -40
View File
@@ -26,6 +26,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -79,16 +83,6 @@ func (r PermissionsList) Auditable() map[string]interface{} {
// Fill processes request and fills internal variables
func (r *PermissionsList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
return err
}
@@ -112,16 +106,6 @@ func (r PermissionsEffective) GetResource() string {
// Fill processes request and fills internal variables
func (r *PermissionsEffective) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -157,16 +141,6 @@ func (r PermissionsRead) GetRoleID() uint64 {
// Fill processes request and fills internal variables
func (r *PermissionsRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -202,16 +176,6 @@ func (r PermissionsDelete) GetRoleID() uint64 {
// Fill processes request and fills internal variables
func (r *PermissionsDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -253,6 +217,7 @@ func (r PermissionsUpdate) GetRules() rbac.RuleSet {
// Fill processes request and fills internal variables
func (r *PermissionsUpdate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
+13 -60
View File
@@ -27,6 +27,10 @@ var (
_ = chi.URLParam
_ = multipart.ErrMessageTooLarge
_ = payload.ParseUint64s
_ = strings.ToLower
_ = io.EOF
_ = fmt.Errorf
_ = json.NewEncoder
)
type (
@@ -465,16 +469,6 @@ func (r RecordReport) GetFilter() string {
// Fill processes request and fills internal variables
func (r *RecordReport) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -600,16 +594,6 @@ func (r RecordList) GetSort() string {
// Fill processes request and fills internal variables
func (r *RecordList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -728,6 +712,7 @@ func (r RecordImportInit) GetUpload() *multipart.FileHeader {
// Fill processes request and fills internal variables
func (r *RecordImportInit) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -816,6 +801,7 @@ func (r RecordImportRun) GetOnError() string {
// Fill processes request and fills internal variables
func (r *RecordImportRun) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -907,16 +893,6 @@ func (r RecordImportProgress) GetSessionID() uint64 {
// Fill processes request and fills internal variables
func (r *RecordImportProgress) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -1000,16 +976,6 @@ func (r RecordExport) GetTimezone() string {
// Fill processes request and fills internal variables
func (r *RecordExport) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
// GET params
@@ -1110,6 +1076,7 @@ func (r RecordExec) GetArgs() []ProcedureArg {
// Fill processes request and fills internal variables
func (r *RecordExec) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1206,6 +1173,7 @@ func (r RecordCreate) GetLabels() map[string]string {
// Fill processes request and fills internal variables
func (r *RecordCreate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1303,16 +1271,6 @@ func (r RecordRead) GetRecordID() uint64 {
// Fill processes request and fills internal variables
func (r *RecordRead) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -1390,6 +1348,7 @@ func (r RecordUpdate) GetLabels() map[string]string {
// Fill processes request and fills internal variables
func (r *RecordUpdate) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1499,6 +1458,7 @@ func (r RecordBulkDelete) GetTruncate() bool {
// Fill processes request and fills internal variables
func (r *RecordBulkDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1584,16 +1544,6 @@ func (r RecordDelete) GetRecordID() uint64 {
// Fill processes request and fills internal variables
func (r *RecordDelete) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
switch {
case err == io.EOF:
err = nil
case err != nil:
return fmt.Errorf("error parsing http request body: %w", err)
}
}
{
var val string
@@ -1665,6 +1615,7 @@ func (r RecordUpload) GetUpload() *multipart.FileHeader {
// Fill processes request and fills internal variables
func (r *RecordUpload) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1767,6 +1718,7 @@ func (r RecordTriggerScript) GetValues() types.RecordValueSet {
// Fill processes request and fills internal variables
func (r *RecordTriggerScript) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)
@@ -1858,6 +1810,7 @@ func (r RecordTriggerScriptOnList) GetScript() string {
// Fill processes request and fills internal variables
func (r *RecordTriggerScriptOnList) Fill(req *http.Request) (err error) {
if strings.ToLower(req.Header.Get("content-type")) == "application/json" {
err = json.NewDecoder(req.Body).Decode(r)