]> kaliko git repositories - mpd-sima.git/commitdiff
Fixed http client not honoring HTTP_PROXY (Closes #3)
authorkaliko <kaliko@azylum.org>
Sun, 11 Oct 2015 09:49:30 +0000 (11:49 +0200)
committerkaliko <kaliko@azylum.org>
Sun, 11 Oct 2015 09:49:30 +0000 (11:49 +0200)
data/man/mpd-sima.1
data/man/mpd_sima.1.xml
doc/Changelog
sima/lib/http.py

index c139e79d8af02ca7ab27d68d14c6e4062430446f..596f9ade469b45f996ad4e6b69bae69ee8b72898 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: mpd-sima
 .\"    Author: Jack Kaliko <kaliko@azylum.org>
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 09/20/2015
+.\"      Date: 10/11/2015
 .\"    Manual: mpd-sima 0.14.0 User Manual
 .\"    Source: mpd-sima
 .\"  Language: English
 .\"
-.TH "MPD\-SIMA" "1" "09/20/2015" "mpd-sima" "mpd-sima 0.14.0 User Manual"
+.TH "MPD\-SIMA" "1" "10/11/2015" "mpd-sima" "mpd-sima 0.14.0 User Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -253,6 +253,13 @@ syntax as documented in mpc manual, cf\&.
 .br
 To use a password, provide a value of the form "password@host"\&.
 .RE
+.PP
+\fBHTTP_PROXY\fR, \fBHTTPS_PROXY\fR
+.RS 4
+mpd\-sima honors
+\fBHTTP_PROXY\fR
+environment variables\&.
+.RE
 .SH "CONFIGURATION"
 .PP
 mpd_sima\&.cfg
index c0b59d49a63f891cd40bf1cac4cc1d3a6e68775b..16810bddd9f6d884e0824cb0ac08054d3f442082 100644 (file)
@@ -241,6 +241,12 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
                   </para>
               </listitem>
           </varlistentry>
+          <varlistentry>
+              <term><envar>HTTP_PROXY</envar>, <envar>HTTPS_PROXY</envar></term>
+              <listitem>
+                  <para>&dhutils; honors <envar>HTTP_PROXY</envar> environment variables.</para>
+              </listitem>
+          </varlistentry>
       </variablelist>
   </refsect1>
   <refsect1 id="configuration">
index 03d5ee32809b95e81942a7d262f1a7b6bc5232f0..ccfe3c6ab107259219d0470ac3a1d85951f3cdb6 100644 (file)
@@ -8,6 +8,7 @@ MPD_sima v0.14.0
  * Fixed http cache for lastFM
  * Cleanup code (removed users similarities)
  * Make "var-dir" option default name instead of "var_dir"
+ * Honor HTTP_PROXY env. var.
 
 -- kaliko jack <kaliko@azylum.org> UNRELEASED
 
index 0c1b3968d90ce31bfcb13fbadd4c948c22d2289a..10fae9c475204852b73eabe039447d4d5d4497e4 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-# Copyright (c) 2014 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2014-2015 Jack Kaliko <kaliko@azylum.org>
 # Copyright (c) 2012, 2013 Eric Larson <eric@ionrock.org>
 #
 #   This program is free software: you can redistribute it and/or modify
@@ -301,7 +301,8 @@ class HttpClient:
     def fetch_ws(self, prepreq):
         """fetch from web service"""
         sess = Session()
-        resp = sess.send(prepreq, timeout=SOCKET_TIMEOUT)
+        settings = sess.merge_environment_settings(prepreq.url, {}, None, False, None)
+        resp = sess.send(prepreq, timeout=SOCKET_TIMEOUT, **settings)
         if resp.status_code == 304:
             self.stats.update(etag=self.stats.get('etag')+1)
             resp = self.controller.update_cached_response(prepreq, resp)