From 8f407a2a9e7bb61f2db9c766acae3e07ae307cb1 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Thu, 6 Nov 2025 13:59:09 +0400 Subject: [PATCH] fixing custom asset id --- cmd/httpx/httpx.go | 3 ++- internal/pdcp/writer.go | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/httpx/httpx.go b/cmd/httpx/httpx.go index 77e06058..242ecc69 100644 --- a/cmd/httpx/httpx.go +++ b/cmd/httpx/httpx.go @@ -131,10 +131,11 @@ func setupOptionalAssetUpload(opts *runner.Options) *pdcp.UploadWriter { opts.OnClose = func() { writer.Close() } + // add additional metadata if opts.AssetID != "" { // silently ignore - _ = writer.SetAssetID(opts.AssetID) + writer.SetAssetID(opts.AssetID) } if opts.AssetName != "" { // silently ignore diff --git a/internal/pdcp/writer.go b/internal/pdcp/writer.go index aa6dc488..fbad91ab 100644 --- a/internal/pdcp/writer.go +++ b/internal/pdcp/writer.go @@ -99,12 +99,11 @@ func (u *UploadWriter) GetWriterCallback() runner.OnResultCallback { } // SetAssetID sets the scan id for the upload writer -func (u *UploadWriter) SetAssetID(id string) error { +func (u *UploadWriter) SetAssetID(id string) { if !xidRegex.MatchString(id) { - return fmt.Errorf("invalid asset id provided") + gologger.Warning().Msgf("invalid asset id provided (unknown xid format): %s", id) } u.assetGroupID = id - return nil } // SetAssetGroupName sets the scan name for the upload writer