You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Artifactory client does not support requests without Content-Type header. GET requests don't have Content-Type header and some endpoints in Artifactory do not expect this header to be provided (e.g. 'api/v1/service_trust/pairings/federated-repo/*'). As a result when executing such requests we get "message" : "Unsupported Media Type" because Client adds Content-Type: */* by default.
To Reproduce
Artifactory artifactory = ArtifactoryClientBuilder.create()
.setUrl("ArtifactoryUrl")
.setUsername("username")
.setPassword("password")
.build();
ArtifactoryRequest ar = new ArtifactoryRequestImpl()
.method(ArtifactoryRequest.Method.GET)
.apiUrl("api/v1/service_trust/pairings/federated-repo/*")
artifactory.restCall(ar)
Expected behavior
Allow requests to be sent without Content-Type header
Additional context
In order not to break existing behavior, it would be safe to support requests with requestType == null. But Currently this line ContentType contentType = Util.getContentType(artifactoryRequest.getRequestType());
throws NPE if requestType == null
The text was updated successfully, but these errors were encountered:
Describe the bug
Artifactory client does not support requests without Content-Type header. GET requests don't have Content-Type header and some endpoints in Artifactory do not expect this header to be provided (e.g. 'api/v1/service_trust/pairings/federated-repo/*'). As a result when executing such requests we get
"message" : "Unsupported Media Type"
because Client addsContent-Type: */*
by default.To Reproduce
Expected behavior
Allow requests to be sent without Content-Type header
Additional context
In order not to break existing behavior, it would be safe to support requests with
requestType == null
. But Currently this lineContentType contentType = Util.getContentType(artifactoryRequest.getRequestType());
throws NPE if
requestType == null
The text was updated successfully, but these errors were encountered: