Skip to content

Commit 327f407

Browse files
authored
Merge pull request #259 from lcarva/RHTAP-5241
Remove chunked encoding
2 parents 0cab66e + ad27465 commit 327f407

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
@@ -179,21 +179,20 @@ for sbom_path in "${sboms_to_upload[@]}"; do
179179
token_type="$(jq -r .token_type <<< "$token_response")"
180180
expires_in="$(jq -r ".expires_in // empty" <<< "$token_response")"
181181

182-
retry_max_time=0 # no limit
182+
retry_max_time=600 # 10 minutes as the default value
183183
if [[ -n "$expires_in" ]]; then
184-
retry_max_time="$expires_in"
184+
retry_max_time="$expires_in" # Adjust timeout to match token expiration
185185
fi
186186

187187
# This sbom_id is the one created in the gather-sboms step - sha256:${checksum}
188188
sbom_id="$(basename -s .json "$sbom_path")"
189189
supported_version_of_sbom="${sbom_path}.supported_version"
190190

191-
echo "Uploading SBOM to $bombastic_api_url (with id=$sbom_id)"
191+
echo "Uploading SBOM to $bombastic_api_url (with id=$sbom_id) [retry_max_time=$retry_max_time]"
192192
# https://docs.trustification.dev/trustification/user/bombastic.html#publishing-an-sbom-doc
193193
curl "${curl_opts[@]}" \
194194
--retry-max-time "$retry_max_time" \
195195
-H "authorization: $token_type $access_token" \
196-
-H "transfer-encoding: chunked" \
197196
-H "content-type: application/json" \
198197
--data "@$supported_version_of_sbom" \
199198
"$bombastic_api_url/api/v2/sbom?id=$sbom_id"

0 commit comments

Comments
 (0)