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

[1.4.x] lm 1.4.1 #6159

Merged
merged 1 commit into from
Nov 22, 2020
Merged

[1.4.x] lm 1.4.1 #6159

merged 1 commit into from
Nov 22, 2020

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Nov 22, 2020

Ref sbt/ivy#40
Fixes #5483

from Set explicit HTTP Accept header to avoid text/html

By default, java.net.HttpURLConnection HTTP Accept header is set to text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

This leads to Microsoft servers responding with a 203 status code and an HTML pages when uploading or downloading artifacts to Azure Artifacts.

Given that Maven also have a similar issue (text/html as the preferred response content-type), Microsoft has implemented a workaround that ignores the Accept header values when User-Agent is Apache Maven/*. However, this workaround is not implemented on their side for SBT.

This pull request sets HTTP Accept header to application/octet-stream, application/json, application/xml, */* to fix this behavior, as evidenced here:

https://dev.azure.com/aironek/sbt-test/_build/results?buildId=43&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=b60649db-91ed-45ce-b0dd-c9633ee87772

Given that the last component is */*, this shoud be backward-compatible with other serivces (Nexus, Artifactory, etc) that reply with different content-types.

@eed3si9n eed3si9n changed the title lm 1.4.1 [1.4.x] lm 1.4.1 Nov 22, 2020
@eed3si9n eed3si9n added this to the 1.4.4 milestone Nov 22, 2020
@eed3si9n eed3si9n merged commit 0c34137 into sbt:1.4.x Nov 22, 2020
@eed3si9n eed3si9n deleted the wip/bump branch November 22, 2020 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant