orthecreedence / drakma-async

An asynchronous version of drakma that runs off of cl-async
38 stars 5 forks source link

4th value of http-request isnt correct? #17

Closed nightshade427 closed 10 years ago

nightshade427 commented 10 years ago

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/>
nightshade427 commented 10 years ago

Any ideas?

orthecreedence commented 10 years ago

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).

nightshade427 commented 10 years ago

Awesome, thanks! :)

orthecreedence commented 10 years ago

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.

nightshade427 commented 10 years ago

Works great!!

Thanks :)

orthecreedence commented 10 years ago

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

nightshade427 commented 10 years ago

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

nightshade427 commented 10 years ago

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>  
nightshade427 commented 10 years ago

Any ideas on work around?

orthecreedence commented 10 years ago

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.

nightshade427 commented 10 years ago

kk, let me know

orthecreedence commented 10 years ago

Please do a pull and try now =]

nightshade427 commented 10 years ago

Works great! Thanks ;)