Revert "Assert on request headers only (#57792)"
This reverts commit b5d3565214
.
This commit is contained in:
parent
1e8e115ae1
commit
8199956937
|
@ -302,13 +302,6 @@ public final class ThreadContext implements Writeable {
|
|||
return Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the request headers, without the default headers
|
||||
*/
|
||||
public Map<String, String> getRequestHeadersOnly() {
|
||||
return Collections.unmodifiableMap(new HashMap<>(threadLocal.get().requestHeaders));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a copy of all <em>response</em> headers.
|
||||
*
|
||||
|
|
|
@ -62,9 +62,9 @@ public enum Transports {
|
|||
}
|
||||
|
||||
public static boolean assertDefaultThreadContext(ThreadContext threadContext) {
|
||||
assert threadContext.getRequestHeadersOnly().isEmpty() ||
|
||||
threadContext.getRequestHeadersOnly().size() == 1 && threadContext.getRequestHeadersOnly().containsKey(Task.X_OPAQUE_ID) :
|
||||
"expected empty context but was " + threadContext.getRequestHeadersOnly() + " on " + Thread.currentThread().getName();
|
||||
assert threadContext.getHeaders().isEmpty() ||
|
||||
threadContext.getHeaders().size() == 1 && threadContext.getHeaders().containsKey(Task.X_OPAQUE_ID) :
|
||||
"expected empty context but was " + threadContext.getHeaders() + " on " + Thread.currentThread().getName();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue