Mercurial > hg
diff mercurial/url.py @ 42109:2a3c0106ded9
import: suppress accept: header
irccloud and others may perform content negotation and reject (406)
if the accept header does not match the mime type of the object
author | timeless <timeless@mozdev.org> |
---|---|
date | Fri, 12 Apr 2019 12:20:38 -0400 |
parents | 544035846830 |
children | 2372284d9457 |
line wrap: on
line diff
--- a/mercurial/url.py Fri Apr 12 12:06:13 2019 -0400 +++ b/mercurial/url.py Fri Apr 12 12:20:38 2019 -0400 @@ -601,7 +601,7 @@ return opener -def open(ui, url_, data=None): +def open(ui, url_, data=None, sendaccept=True): u = util.url(url_) if u.scheme: u.scheme = u.scheme.lower() @@ -610,7 +610,9 @@ path = util.normpath(os.path.abspath(url_)) url_ = 'file://' + pycompat.bytesurl(urlreq.pathname2url(path)) authinfo = None - return opener(ui, authinfo).open(pycompat.strurl(url_), data) + return opener(ui, authinfo, + sendaccept=sendaccept).open(pycompat.strurl(url_), + data) def wrapresponse(resp): """Wrap a response object with common error handlers.