skysanjay opened a new pull request, #3902:
URL: https://github.com/apache/solr/pull/3902

   https://issues.apache.org/jira/browse/SOLR-17787
   
   * SOLR-17787: CborResponseWriter should use content-type: application/cbor
   
   # Description
   
   Currently, when Solr returns a response in CBOR format, the Content-Type 
header is application/octet-stream, the same as it is for javabin.
   
   However, the RFC for the CBOR format ([RFC 
8949](https://datatracker.ietf.org/doc/html/rfc8949#name-media-types-registry)) 
specifies that application/cbor should be used as the Content-Type.
   
   Modern HTTP client implementations (for example, Spring's RestClient) have a 
feature that automatically switches the response deserializer based on the 
Content-Type. Due to Solr's current implementation, this feature cannot be 
used, requiring the deserializer to be switched manually.
   
   By using Content-Type: application/cbor when returning CBOR-formatted 
responses, Solr would comply with internet standards and potentially reduce the 
implementation cost for HTTP clients.
   # Solution
   
   By using Content-Type: application/cbor when returning CBOR-formatted 
responses, Solr would comply with internet standards and potentially reduce the 
implementation cost for HTTP clients
   
   # Tests
   
   modified Junti [TestRawResponseWriter.java] to ensure that response writer 
is being called based on response content type 'applicaiton/cbor' and validate 
the binary output
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [X] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.
   - [X] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [X] I have given Solr maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended, not available for 
branches on forks living under an organisation)
   - [X] I have developed this patch against the `main` branch.
   - [X] I have run `./gradlew check`.
   - [X] I have added tests for my changes.
   - [X] I have added documentation for the [Reference 
Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   - [X] I have added a [changelog 
entry](https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc) for my 
change
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to