ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/go/pkg/mod/github.com/aws/[email protected]/service/s3/statusok_error.go
package s3

import (
	"bytes"
	"io"
	"io/ioutil"
	"net/http"

	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/internal/sdkio"
)

func copyMultipartStatusOKUnmarshalError(r *request.Request) {
	b, err := ioutil.ReadAll(r.HTTPResponse.Body)
	r.HTTPResponse.Body.Close()
	if err != nil {
		r.Error = awserr.NewRequestFailure(
			awserr.New(request.ErrCodeSerialization, "unable to read response body", err),
			r.HTTPResponse.StatusCode,
			r.RequestID,
		)
		// Note, some middleware later in the stack like restxml.Unmarshal expect a valid, non-closed Body
		// even in case of an error, so we replace it with an empty Reader.
		r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(nil))
		return
	}

	body := bytes.NewReader(b)
	r.HTTPResponse.Body = ioutil.NopCloser(body)
	defer body.Seek(0, sdkio.SeekStart)

	unmarshalError(r)
	if err, ok := r.Error.(awserr.Error); ok && err != nil {
		if err.Code() == request.ErrCodeSerialization &&
			err.OrigErr() != io.EOF {
			r.Error = nil
			return
		}
		// if empty payload
		if err.OrigErr() == io.EOF {
			r.HTTPResponse.StatusCode = http.StatusInternalServerError
		} else {
			r.HTTPResponse.StatusCode = http.StatusServiceUnavailable
		}
	}
}