Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type header ignored #660

Closed
bearn01d opened this issue Feb 5, 2024 · 3 comments · Fixed by #661
Closed

Content-Type header ignored #660

bearn01d opened this issue Feb 5, 2024 · 3 comments · Fixed by #661
Labels
kind/bug Something isn't working. The software does not behave as expected or specified.

Comments

@bearn01d
Copy link

bearn01d commented Feb 5, 2024

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.

@bearn01d bearn01d added the kind/bug Something isn't working. The software does not behave as expected or specified. label Feb 5, 2024
@tmberthold
Copy link

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

@SebastianOpriel
Copy link
Member

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
Copy link
Author

@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).

#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working. The software does not behave as expected or specified.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants