public Builder setHeader(String key, LazyHeaderFactory factory) {
            copyIfNecessary();
            if (factory == null) {
                headers.remove(key);
            } else {
                List<LazyHeaderFactory> factories = getFactories(key);
                factories.clear();
                factories.add(factory);
            }

            if (isEncodingDefault && ENCODING_HEADER.equalsIgnoreCase(key)) {
                isEncodingDefault = false;
            }
            if (isUserAgentDefault && USER_AGENT_HEADER.equalsIgnoreCase(key)) {
                isUserAgentDefault = false;
            }

            return this;
        }
Replaces all existing {@link LazyHeaderFactory LazyHeaderFactorys} for the given key
with the given {@link LazyHeaderFactory}.

<p> If the given value is {@code null}, the header at the given key will be removed. </p>
core/src/main/java/com/bumptech/glide/load/model/LazyHeaders.java