Skip to content

Added comment about ML-Check-ML11-Headers #1584

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

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4201,12 +4201,18 @@ private Request.Builder addTelemetryAgentId(Request.Builder requestBldr) {
return requestBldr.header("ML-Agent-ID", "java");
}

/**
* Per https://docs.marklogic.com/10.0/guide/relnotes/chap3#id_73268 , support for ML-Check-ML11-Headers was added
* for MarkLogic 10.0-9. It is no longer needed in MarkLogic 11 or later. The addition of it will not cause any
* harm, but it can be removed once the Java client no longer needs to support MarkLogic 10.
*
* @param requestBldr
* @param path
* @return
*/
private Request.Builder addTrailerHeadersIfNecessary(Request.Builder requestBldr, String path) {
if ("rows".equals(path)) {
// Standard header supported by ML 11
requestBldr.addHeader("TE", "trailers");

// Proprietary header recognized by ML 10.0-9, per https://docs.marklogic.com/guide/relnotes/chap3#id_73268
requestBldr.addHeader("ML-Check-ML11-Headers", "true");
}
return requestBldr;
Expand Down