[REBOL] Re: Amazon S3 Tools linux problem.
From: compkarori:gma:il at: 20-Sep-2010 20:57
Carl
the errors are not very informative, but the headers sent by Amazon do hold
the error information you need.
So, we need to modify the http protocol to give this to us .. eg.
create a global to capture the headers
protocol-http-header: none
at the top of the protocol, add this function
unless port/locals [port/locals: make object! [list: copy [] headers: none
querying: no]]
generic-proxy?: all [port/proxy/type = 'generic not none? port/proxy/host]
>>> add here
save-header: func [ obj ][
protocol-http-header: obj
obj
]
and change the success function to this:
success: [
headers: make string! 500
while [ ( line: pick port/sub-port 1 ) <> "" ] [append headers join line
^/
] ; remove the headers
port/locals/headers: headers: save-header Parse-Header HTTP-Header headers
port/size: 0
if port/locals/querying [if headers/Content-Length [port/size: load
headers/Content-Length]]
if error? try [port/date: parse-header-date headers/Last-Modified]
[port/date: none]
port/status: 'file
]
so, now when it fails, you can inspect the value of the protocol-http-header
to see what Amazon doesn't like about the authentication.
HTH
On Mon, Sep 20, 2010 at 8:37 PM, Graham Chiu <compkarori-gmail.com> wrote:
> Hi Carl
>
> I never tested on Linux ... but the forbidden error suggests that the
> authentication is not working.
> As an alternative Chris rewrote this as a protocol. Perhaps try that as
> well?
>
> http://www.ross-gill.com/r/s3http.r
>
> If you find the problem, let me know so I can fix it :)
>
> On Mon, Sep 20, 2010 at 8:22 PM, Carl Read <carl-cybercraft.co.nz> wrote:
>
>>
>> Hi all,
>>
>> I've got the Amazon S3 tools (see: http://rebol.wik.is/S3 ) to work on
>> Windows XP, but I get a 403 Forbidden error on Linux when using the
>> Get-s3object function to try and download a file. (I've not tried uploading
>> from Linux yet.)
>>
>> Does anyone know what could be causing the difference in behaviour? (Note
>> I'm no Linux expert.)
>>
>> -- Carl Read.
>>
>> --
>> To unsubscribe from the list, just send an email to
>> lists at rebol.com with unsubscribe as the subject.
>>
>>
>
> --
> Graham Chiu
> http://www.compkarori.co.nz:8090/
> Synapse - the use from anywhere EMR.
>
--
Graham Chiu
http://www.compkarori.co.nz:8090/
Synapse - the use from anywhere EMR.