File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 7474* Work log
7575  Log of merges/issues/work that's gone in so I know what to put in
7676  the changelog for the next release
77+ ** 2012-02-05
78+    - merged https://github.com/dakrone/clj-http/pull/42 to allow
79+      strings or keywords for :scheme in requests
80+    - added test for different :schemes
7781** Release 0.3.1
7882** 2012-02-03
7983   - merged https://github.com/dakrone/clj-http/pull/40 to allow
Original file line number Diff line number Diff line change 114114
115115(defn-  default-proxy-host-for 
116116  [scheme]
117-   (System/getProperty  (str  ( name   scheme)  " .proxyHost"  )))
117+   (System/getProperty  (str  scheme " .proxyHost"  )))
118118
119119(defn-  default-proxy-port-for 
120120  [scheme]
121-   (Integer/parseInt  (System/getProperty  (str  ( name   scheme)  " .proxyPort"  ))))
121+   (Integer/parseInt  (System/getProperty  (str  scheme " .proxyPort"  ))))
122122
123123(defn  add-client-params! 
124124  " Add various client params to the http-client object, if needed." 
169169           proxy-port as] :as  req}]
170170  (let  [conn-mgr (or  *connection-manager* (make-regular-conn-manager  insecure?))
171171        http-client (DefaultHttpClient. 
172-                       ^org.apache.http.conn.ClientConnectionManager conn-mgr)]
172+                       ^org.apache.http.conn.ClientConnectionManager conn-mgr)
173+         scheme (name  scheme)]
173174    (add-client-params!  http-client scheme socket-timeout
174175                        conn-timeout server-name proxy-host proxy-port)
175-     (let  [http-url (str  ( name   scheme)  " ://"   server-name
176+     (let  [http-url (str  scheme " ://"   server-name
176177                        (when  server-port (str  " :"   server-port))
177178                        uri
178179                        (when  query-string (str  " ?"   query-string)))
Original file line number Diff line number Diff line change 1414(deftest  ^{:integration  true } roundtrip 
1515  (run-server )
1616  (Thread/sleep  1000 )
17+   ; ; roundtrip with scheme as a keyword
1718  (let  [resp (client/request  (merge  base-req {:uri  " /get"   :method  :get }))]
1819    (is  (=  200  (:status  resp)))
1920    (is  (=  " close"   (get-in  resp [:headers  " connection"  ])))
21+     (is  (=  " get"   (:body  resp))))
22+   ; ; roundtrip with scheme as a string
23+   (let  [resp (client/request  (merge  base-req {:uri  " /get"   :method  :get 
24+                                               :scheme  " http"  }))]
25+     (is  (=  200  (:status  resp)))
26+     (is  (=  " close"   (get-in  resp [:headers  " connection"  ])))
2027    (is  (=  " get"   (:body  resp)))))
2128
2229(defn  is-passed  [middleware req]
3946    (is  (=  200  (:status  resp)))
4047    (is  (=  :get  (:request-method  (:req  resp))))
4148    (is  (=  :http  (:scheme  (:req  resp))))
49+ 
4250    (is  (=  " /bat"   (:uri  (:req  resp))))))
4351
4452(deftest  redirect-to-get-on-head 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments