chore(deps): bump golang.org/x/image from 0.19.0 to 0.20.0

Bumps [golang.org/x/image](https://github.com/golang/image) from 0.19.0 to 0.20.0.
- [Commits](https://github.com/golang/image/compare/v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-09-18 06:51:17 +00:00
committed by Ralf Haferkamp
parent ceb29e63fc
commit ffa8855b87
4 changed files with 4 additions and 24 deletions

2
go.mod
View File

@@ -104,7 +104,7 @@ require (
go.opentelemetry.io/otel/trace v1.30.0
golang.org/x/crypto v0.27.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
golang.org/x/image v0.19.0
golang.org/x/image v0.20.0
golang.org/x/net v0.29.0
golang.org/x/oauth2 v0.22.0
golang.org/x/sync v0.8.0

4
go.sum
View File

@@ -1314,8 +1314,8 @@ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.19.0 h1:D9FX4QWkLfkeqaC62SonffIIuYdOk/UE2XKUBgRIBIQ=
golang.org/x/image v0.19.0/go.mod h1:y0zrRqlQRWQ5PXaYCOMLTW2fpsxZ8Qh9I/ohnInJEys=
golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw=
golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

View File

@@ -199,7 +199,6 @@ func (handler *UnroutedHandler) Middleware(h http.Handler) http.Handler {
if origin := r.Header.Get("Origin"); !cors.Disable && origin != "" {
originIsAllowed := cors.AllowOrigin.MatchString(origin)
if !originIsAllowed {
fmt.Println("ORIGIN IS NOT ALLOWED", origin)
handler.sendError(c, ErrOriginNotAllowed)
return
}
@@ -692,14 +691,12 @@ func (handler *UnroutedHandler) HeadFile(w http.ResponseWriter, r *http.Request)
// PatchFile adds a chunk to an upload. This operation is only allowed
// if enough space in the upload is left.
func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request) {
fmt.Println("PATCH FILE")
c := handler.getContext(w, r)
isTusV1 := !handler.usesIETFDraft(r)
// Check for presence of application/offset+octet-stream
if isTusV1 && r.Header.Get("Content-Type") != "application/offset+octet-stream" {
fmt.Println("WRONG CONTENT TYPE")
handler.sendError(c, ErrInvalidContentType)
return
}
@@ -707,14 +704,12 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
// Check for presence of a valid Upload-Offset Header
offset, err := strconv.ParseInt(r.Header.Get("Upload-Offset"), 10, 64)
if err != nil || offset < 0 {
fmt.Println("WRONG OFFSET")
handler.sendError(c, ErrInvalidOffset)
return
}
id, err := extractIDFromPath(r.URL.Path)
if err != nil {
fmt.Println("WRONG ID")
handler.sendError(c, err)
return
}
@@ -723,7 +718,6 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
if handler.composer.UsesLocker {
lock, err := handler.lockUpload(c, id)
if err != nil {
fmt.Println("WRONG LOCK")
handler.sendError(c, err)
return
}
@@ -733,27 +727,23 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
upload, err := handler.composer.Core.GetUpload(c, id)
if err != nil {
fmt.Println("WRONG UPLOAD")
handler.sendError(c, err)
return
}
info, err := upload.GetInfo(c)
if err != nil {
fmt.Println("WRONG INFO")
handler.sendError(c, err)
return
}
// Modifying a final upload is not allowed
if info.IsFinal {
fmt.Println("WRONG FINAL")
handler.sendError(c, ErrModifyFinal)
return
}
if offset != info.Offset {
fmt.Println("WRONG INFO OFFSET")
handler.sendError(c, ErrMismatchOffset)
return
}
@@ -770,32 +760,27 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
// Do not proxy the call to the data store if the upload is already completed
if !info.SizeIsDeferred && info.Offset == info.Size {
resp.Header["Upload-Offset"] = strconv.FormatInt(offset, 10)
fmt.Println("UPLOAD ALREADY COMPLETED")
handler.sendResp(c, resp)
return
}
if r.Header.Get("Upload-Length") != "" {
if !handler.composer.UsesLengthDeferrer {
fmt.Println("UPLOAD LENGTH DEFERRER")
handler.sendError(c, ErrNotImplemented)
return
}
if !info.SizeIsDeferred {
fmt.Println("UPLOAD LENGTH NOT DEFERED")
handler.sendError(c, ErrInvalidUploadLength)
return
}
uploadLength, err := strconv.ParseInt(r.Header.Get("Upload-Length"), 10, 64)
if err != nil || uploadLength < 0 || uploadLength < info.Offset || (handler.config.MaxSize > 0 && uploadLength > handler.config.MaxSize) {
fmt.Println("UPLOAD LENGTH INVALID")
handler.sendError(c, ErrInvalidUploadLength)
return
}
lengthDeclarableUpload := handler.composer.LengthDeferrer.AsLengthDeclarableUpload(upload)
if err := lengthDeclarableUpload.DeclareLength(c, uploadLength); err != nil {
fmt.Println("UPLOAD LENGTH DECLARED")
handler.sendError(c, err)
return
}
@@ -806,7 +791,6 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
resp, err = handler.writeChunk(c, resp, upload, info)
if err != nil {
fmt.Println("CANT WRITE CHUNK")
handler.sendError(c, err)
return
}
@@ -815,7 +799,6 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
if willCompleteUpload && info.SizeIsDeferred {
info, err = upload.GetInfo(c)
if err != nil {
fmt.Println("CANT GET INFO")
handler.sendError(c, err)
return
}
@@ -824,7 +807,6 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
lengthDeclarableUpload := handler.composer.LengthDeferrer.AsLengthDeclarableUpload(upload)
if err := lengthDeclarableUpload.DeclareLength(c, uploadLength); err != nil {
fmt.Println("CANT UPLOAD LENGTH")
handler.sendError(c, err)
return
}
@@ -834,14 +816,12 @@ func (handler *UnroutedHandler) PatchFile(w http.ResponseWriter, r *http.Request
resp, err = handler.finishUploadIfComplete(c, resp, upload, info)
if err != nil {
fmt.Println("CANT COMPLETE")
handler.sendError(c, err)
return
}
}
handler.sendResp(c, resp)
fmt.Println("PATCH COMPLETE")
}
// writeChunk reads the body from the requests r and appends it to the upload

2
vendor/modules.txt vendored
View File

@@ -2169,7 +2169,7 @@ golang.org/x/exp/slices
golang.org/x/exp/slog
golang.org/x/exp/slog/internal
golang.org/x/exp/slog/internal/buffer
# golang.org/x/image v0.19.0
# golang.org/x/image v0.20.0
## explicit; go 1.18
golang.org/x/image/bmp
golang.org/x/image/ccitt