orthecreedence/drakma-async

4th value of http-request isnt correct?

nightshade427 opened this issue · 13 comments

Using drakma with like the following

(drakma:http-request "http://www.translationadmin.com" :preserve-uri t :additional-headers '((:accept . "text/html")))

I get the following for the 4th value, which is correct

#<PURI:URI http://www.translationadmin.com/login>

But if I use drakma async with the following

(as:with-event-loop (:catch-app-errors t)                                                                                                                                        
           (asf:multiple-future-bind (nil nil nil d)                                                                                                                                      
               (drakma-async:http-request "http://www.translationadmin.com" :preserve-uri t :additional-headers '((:accept . "text/html")))                                               
             (format t "~s" d)))  

I get this which isnt correct :(

#<PURI:URI http://www.translationadmin.com/>

Any ideas?

Hmm reviewing everything, I thought I found the problem, but after closer inspection the code looks fine. I'll review it a bit closer when I get home (next hour or so).

Awesome, thanks! :)

I believe this is fixed by 613891e. Please confirm!

Took a lot of digging, but I finally found it, and managed to fix another bug or two while rooting around.

Works great!!

Thanks :)

Thanks for all the reports...this library would be a lot buggier without you!

Thanks for the awesome package and great support, you rock!

Okay new issue with same 4th value. Even though it is 200 and has no redirect the scheme is changed from https to http.

(as:with-event-loop (:catch-app-errors t)                                                                                                                                        
           (asf:multiple-future-bind (body status headers ruri)                                                                                                                           
               (drakma-async:http-request "https://www.firma8.com/assets/logo.png" :method :head :additional-headers '(("Connection" . "close")))                                         
             (format t "~s ~s ~s ~s" body status headers ruri)))                                                                                                                          
HEAD /assets/logo.png HTTP/1.1                                                                                                                                                            
Host: www.firma8.com                                                                                                                                                                      
User-Agent: Drakma/1.3.9 (SBCL 1.1.18; Linux; 3.14.4-x86_64-linode40; http://weitz.de/drakma/)                                                                                            
Accept: */*                                                                                                                                                                               
Connection: close                                                                                                                                                                         

HTTP/1.1 200 OK                                                                                                                                                                           
Server: nginx/1.2.2                                                                                                                                                                       
Date: Wed, 25 Jun 2014 02:12:18 GMT                                                                                                                                                       
Content-Type: image/png                                                                                                                                                                   
Content-Length: 6244                                                                                                                                                                      
Last-Modified: Tue, 22 Apr 2014 16:48:38 GMT                                                                                                                                              
Connection: close                                                                                                                                                                         
Expires: Thu, 31 Dec 2037 23:55:55 GMT                                                                                                                                                    
Cache-Control: max-age=315360000                                                                                                                                                          
Cache-Control: public                                                                                                                                                                     
Accept-Ranges: bytes                                                                                                                                                                      

NIL 200 ((:SERVER . "nginx/1.2.2")                                                                                                                                                        
         (:DATE . "Wed, 25 Jun 2014 02:12:18 GMT")                                                                                                                                        
         (:CONTENT-TYPE . "image/png") (:CONTENT-LENGTH . "6244")                                                                                                                         
         (:LAST-MODIFIED . "Tue, 22 Apr 2014 16:48:38 GMT")                                                                                                                               
         (:CONNECTION . "close")                                                                                                                                                          
         (:EXPIRES . "Thu, 31 Dec 2037 23:55:55 GMT")                                                                                                                                     
         (:CACHE-CONTROL . "max-age=315360000,public")                                                                                                                                    
         (:ACCEPT-RANGES . "bytes")) #<PURI:URI http://www.firma8.com/assets/logo.png>  

Any ideas on work around?

Hey, been a hard two weeks, hence the delay...probably won't be able to look at this for a few days. Hang in there, I'll be back in the game soon.

kk, let me know

Please do a pull and try now =]

Works great! Thanks ;)