diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java b/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java index 271f151c1..4bae8fc27 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java @@ -123,12 +123,10 @@ public class Request { * Any default headers that the implementation may have, should be overridden by these. */ public Builder headers(@Nullable Map> headers) { - if (headers == null) { - this.headers.clear(); - return this; - } this.headers.clear(); - this.headers.putAll(headers); + if (headers != null) { + this.headers.putAll(headers); + } return this; }