Skip to content

Commit 920f3f4

Browse files
authored
Merge pull request #327 from rhopp/RHTAP-5241-1.7
Remove chunked encoding
2 parents 1cb8b3b + 999e6a2 commit 920f3f4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rhtap/upload-sbom-to-trustification.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,21 +186,20 @@ for sbom_path in "${sboms_to_upload[@]}"; do
186186
token_type="$(jq -r .token_type <<< "$token_response")"
187187
expires_in="$(jq -r ".expires_in // empty" <<< "$token_response")"
188188

189-
retry_max_time=0 # no limit
189+
retry_max_time=600 # 10 minutes as the default value
190190
if [[ -n "$expires_in" ]]; then
191-
retry_max_time="$expires_in"
191+
retry_max_time="$expires_in" # Adjust timeout to match token expiration
192192
fi
193193

194194
# This sbom_id is the one created in the gather-sboms step - sha256:${checksum}
195195
sbom_id="$(basename -s .json "$sbom_path")"
196196
supported_version_of_sbom="${sbom_path}.supported_version"
197197

198-
echo "Uploading SBOM to $bombastic_api_url (with id=$sbom_id)"
198+
echo "Uploading SBOM to $bombastic_api_url (with id=$sbom_id) [retry_max_time=$retry_max_time]"
199199
# https://docs.trustification.dev/trustification/user/bombastic.html#publishing-an-sbom-doc
200200
curl "${curl_opts[@]}" \
201201
--retry-max-time "$retry_max_time" \
202202
-H "authorization: $token_type $access_token" \
203-
-H "transfer-encoding: chunked" \
204203
-H "content-type: application/json" \
205204
--data "@$supported_version_of_sbom" \
206205
"$bombastic_api_url/api/v2/sbom?id=$sbom_id"

0 commit comments

Comments
 (0)