sovity / edc-ui

Connector UI for the sovity EDC Community Edition.
https://sovity.de/en/connect-to-data-space-en/
Apache License 2.0
33 stars 14 forks source link

Content-Type header ignored #660

Closed bearn01d closed 6 months ago

bearn01d commented 8 months ago

Bug Report

Description

As the asset properties are not available in the negotiated contract on the consuming side, one needs to provide the Content-Type header manually when starting a transfer.

This header is currently ignored so that the actual request always has the default application/octet-stream type. The reason is that the core EDC filters content-type from the additional properties: https://github.com/eclipse-edc/Connector/blob/e484af5244168ac9490471bed893bb0db32e4ff4/spi/data-plane/data-plane-http-spi/src/main/java/org/eclipse/edc/connector/dataplane/http/spi/HttpDataAddress.java#L217. Thus, the default value is used. In consequence, the Content-Type header needs to be passed with its specific URI and not among the other additional headers.

I have a working fix for this and will prepare a PR shortly.

Expected Behavior

I can set the Content-Type header for transfers.

Observed Behavior

The Content-Type header is always set to application/octet-stream.

tmberthold commented 8 months ago

Thank you for contributing! We will take a look at it.

SebastianOpriel commented 7 months ago

I think we are talking about two different things here: a) Data Source CONTENT HEADER -> EDC -> EDC -> Data Sink (referenced issue in upstream repo) b) EDC UI manually set conent header (overwrites data source header) -> EDC -> EDC -> Data Sink (this PR) /CC @richardtreier

bearn01d commented 7 months ago

@SebastianOpriel, exactly, I was talking about b) because the used EDC 0.2.1 doesn't yet have the aforementioned patch (and the asset properties are not yet persisted on the consuming EDC side).

https://github.com/sovity/edc-ui/issues/702 is also related but doesn't resolve this problem as the Content-Type stays an additional header instead of being written to its specific field.