Skip to content

Commit

Permalink
chore: send X-Asset-Ingested header only when needed (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Aug 19, 2024
1 parent 463c992 commit a5279f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dsp_tools/commands/xmlupload/resource_create_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def create_resource(
f"Attempting to create resource {resource.res_id} (label: {resource.label}, iri: {resource.iri})..."
)
resource_dict = self._make_resource_with_values(resource, bitstream_information)
res = self.con.post(route="/v2/resources", data=resource_dict, headers={"X-Asset-Ingested": "true"})
headers = {"X-Asset-Ingested": "true"} if bitstream_information else None
res = self.con.post(route="/v2/resources", data=resource_dict, headers=headers)
return cast(str, res["@id"])

def _make_resource_with_values(
Expand Down

0 comments on commit a5279f1

Please sign in to comment.