-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SignatureDoesNotMatch Issue #56
Comments
Is it possible the join function is causing problems since it defaults to '' for windows instead of the '/' which we require for the web? |
Ok, confirmed that this is the root cause. When I ran my code on linux it works fine... but on windows it breaks. Can someone comment on this? |
I also have this problem when using knox in Windows. Would appreciate any advice on how to work around it. |
Ok I just wrote a workaround to make it work on Windows, in client.js : var utils = require('./utils')
, auth = require('./auth')
, http = require('http')
, url = require('url')
// , join = require('path').join
, mime = require('./mime')
, fs = require('fs');
var platformDependantJoin = require('path').join;
var isWindows = process.platform === 'win32';
var join = function(args){
var s = platformDependantJoin.apply(this, arguments);
return (isWindows) ? s.replace(/\\/g, '/') : s;
} |
Thank you! |
I added this work around. Now the url seems to be fine. But is the PUT OK (PUT //thumbnail/AUSTRALIA.jpg)? _header: 'PUT //thumbnail/AUSTRALIA.jpg/ HTTP/1.1\r\nExpect: 100-continu |
OK. found the problem. var req = s3Client.put('thumbnail/'+filename, { |
If you want to get this working in your project without having to hack
in your |
Using `url.resolve` instead. Fixes AutomatticGH-56.
@domenic This fix breaks the |
yes, I also faced this problem. On Tue, Apr 3, 2012 at 6:21 PM, pedrofaustino <
Thanks, |
@juhap @pedrofaustino @parindam Thanks for the catch; fixed in the abovementioned fork/branch. |
hey, seems this issue still exists when doing an npm install knox. Any thoughts on when it will be pushed to release?? |
@johnrellis knox is basically abandoned at this point. Feel free to use my fork. I'm considering creating a "real fork" (new npm package etc.) soon. |
@domenic ah, ok, thanks. pretty new to node and trying to get a college project together so I can't help I'm afraid! good luck! |
I'm all for a maintainer since we're not using it right now, I dont have admin access to this repo though |
Oh OK cool. Well FWIW if you do track down an admin, @pbouzakis and I are using it daily at work. |
@guille any objections? |
@guille ? |
@visionmedia what s3 or AWS lib are you guys using now, if not this one? |
Fixed differently in acffa44 |
I've worked through numerous examples on this, but still receiving a SignatureDoesNotMatch error when I try to 'put()' a jpeg into S3.
I've used the amazon s3 signature testing tool to troubleshoot and identified a difference between the request I am sending and what amazon expects.
What the amazon test tool expects when I enter the hexcode returned in the StringToSign section,
PUT\n\nimage/jpeg\nThu, 29 Dec 2011 06:32:18 GMT\nx-amz-acl:public-read\n/girlsafaritest2\28.jpg
What I am seeing in console.log in the request object I send out to amazon via the put() call in Knox,
_header: 'PUT \28.jpg HTTP/1.1\r\nExpect: 100-continue\r\nx-amz-acl: public-r
ead\r\nContent-Length: 45800\r\nContent-Type: image/jpeg\r\nDate: Thu, 29 Dec 20
11 06:32:18 GMT\r\nHost: girlsafaritest2.s3.amazonaws.com\r\nAuthorization: AWS
AKIAJ3S7Y6CDASJHLUWA:Tm+8/ljOevwZnoV9sEzduo4rYhw=\r\nConnection: keep-alive\r\n
r\n'
Almost everything matches except I noticed that there are two differences, 1) - the \28.jpg (is the \ causing a problem?) and 2) Amazon expects \n while in the request it uses \r\n (is windows causing an issue? I am running nodejs/knox from Win7)
In case anyone wants to see the code I am using, here it is as well:
fs.readFile('./public/images/mockdata/28.jpg', function(err, buf){
console.log('readfile completed, length is: ' + buf.length);
var req = client.put('28.jpg', {
'Content-Length': buf.length
, 'Content-Type': 'image/jpeg'
});
});
Appreciate any help anyone can provide!
The text was updated successfully, but these errors were encountered: