Artifactory - Bad header value content-type of pom.xml from repo.spring.io

47 Views Asked by At

We are not able to download pom.xml files from repo.spring.io with our updated 'Sonatype Nexus Repository' due to an invalid header value for content-type returned by artifactory.

2024-02-14 06:46:54,705+0000 WARN [xxx] UNKNOWN org.sonatype.nexus.repository.storage.StorageTxImpl - An exception occurred determining the content type of asset org/springframework/ai/spring-ai-openai-spring-boot-starter/0.8.0-SNAPSHOT/spring-ai-openai-spring-boot-starter-0.8.0-20240214.061929-153.pom in repository maven_proxy_repo.spring.io-snapshot

2024-02-14 06:46:54,708+0000 WARN [xxx] UNKNOWN org.sonatype.nexus.repository.view.handlers.ExceptionHandler - Invalid content: GET /org/springframework/ai/spring-ai-openai-spring-boot-starter/0.8.0-SNAPSHOT/spring-ai-openai-spring-boot-starter-0.8.0-20240214.061929-153.pom: org.sonatype.nexus.repository.InvalidContentException: Content type could not be determined: application/x-maven-pom xml

I don't know if this is a bug in Jfrog-Artifactory or a bad configuration by repo.spring.io

curl -L -v "https://repo.spring.io/artifactory/snapshot/org/springframework/ai/spring-ai-openai-spring-boot-starter/0.8.0-SNAPSHOT/spring-ai-openai-spring-boot-starter-0.8.0-20240216.110642-162.pom" > /dev/null

< "content-type: application/x-maven-pom xml"

Note that there is a space in the value. According to RFC, that is not legal: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html

According to Nexus Documentation, the correct value must be "content-type: application/x-maven-pom"

see : Overriding-or-changing-default-MIME-types-for-artifact-downloads

Since the header value does not respect the RFC, we cannot override configuration of our Nexus Repository to accept a such mime-type value

Edit : the milestone repository (https://repo.spring.io/artifactory/milestone/) send a valid header "content-type: application/x-maven-pom+xml"

0

There are 0 best solutions below