@@ -822,7 +822,7 @@ func (r *DefaultRes) SendFile(file string, config ...SendFile) error {
822822 request .SetRequestURI (file )
823823
824824 var (
825- sendFileSize int
825+ sendFileSize int64
826826 hasSendFileSize bool
827827 )
828828
@@ -866,7 +866,7 @@ func (r *DefaultRes) SendFile(file string, config ...SendFile) error {
866866 // Apply cache control header
867867 if status != StatusNotFound && status != StatusForbidden {
868868 if cfg .ByteRange && hasSendFileSize && response .StatusCode () == StatusRequestedRangeNotSatisfiable && len (response .Header .Peek (HeaderContentRange )) == 0 {
869- response .Header .Set (HeaderContentRange , "bytes */" + strconv .Itoa (sendFileSize ))
869+ response .Header .Set (HeaderContentRange , "bytes */" + strconv .FormatInt (sendFileSize , 10 ))
870870 }
871871
872872 if cacheControlValue != "" {
@@ -879,7 +879,7 @@ func (r *DefaultRes) SendFile(file string, config ...SendFile) error {
879879 return nil
880880}
881881
882- func sendFileContentLength (path string , cfg SendFile ) (int , error ) {
882+ func sendFileContentLength (path string , cfg SendFile ) (int64 , error ) {
883883 if cfg .FS != nil {
884884 cleanPath := pathpkg .Clean (utils .TrimLeft (path , '/' ))
885885 if cleanPath == "." {
@@ -889,15 +889,15 @@ func sendFileContentLength(path string, cfg SendFile) (int, error) {
889889 if err != nil {
890890 return 0 , fmt .Errorf ("stat %q: %w" , cleanPath , err )
891891 }
892- return int ( info .Size () ), nil
892+ return info .Size (), nil
893893 }
894894
895895 info , err := os .Stat (filepath .FromSlash (path ))
896896 if err != nil {
897897 return 0 , fmt .Errorf ("stat %q: %w" , path , err )
898898 }
899899
900- return int ( info .Size () ), nil
900+ return info .Size (), nil
901901}
902902
903903// SendStatus sets the HTTP status code and if the response body is empty,
0 commit comments