<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9792">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libgsmhr/fetch_sources.py: fix source code downloading<br><br>For some reason, the 3GPP server started to reject the source<br>code download request:<br><br>  urllib2.HTTPError: HTTP Error 403: Forbidden<br><br>Adding both 'User-Agent' and 'Accept' headers solves the problem.<br><br>Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87<br>---<br>M libgsmhr/fetch_sources.py<br>1 file changed, 6 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/92/9792/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/libgsmhr/fetch_sources.py b/libgsmhr/fetch_sources.py</span><br><span>index a65fff2..6fb1b8e 100755</span><br><span>--- a/libgsmhr/fetch_sources.py</span><br><span>+++ b/libgsmhr/fetch_sources.py</span><br><span>@@ -12,6 +12,10 @@</span><br><span> </span><br><span> </span><br><span> SRC = "http://www.3gpp.org/ftp/Specs/archive/06_series/06.06/0606-421.zip"</span><br><span style="color: hsl(120, 100%, 40%);">+HDR = {</span><br><span style="color: hsl(120, 100%, 40%);">+       "User-Agent": "Mozilla/5.0 (X11; ArchLinux; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0",</span><br><span style="color: hsl(120, 100%, 40%);">+  "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span> </span><br><span> </span><br><span> def get_zipfile(data):</span><br><span>@@ -45,7 +49,8 @@</span><br><span>    os.chdir(tgt)</span><br><span> </span><br><span>    # Get the original data</span><br><span style="color: hsl(0, 100%, 40%);">- u = urllib2.urlopen(SRC)</span><br><span style="color: hsl(120, 100%, 40%);">+      req = urllib2.Request(SRC, headers = HDR)</span><br><span style="color: hsl(120, 100%, 40%);">+     u = urllib2.urlopen(req)</span><br><span>     d = u.read()</span><br><span> </span><br><span>     # Get DISK.zip</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9792">change 9792</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9792"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: gapk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87 </div>
<div style="display:none"> Gerrit-Change-Number: 9792 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>