Skip to content
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

BucketName is empty #185

Closed
AlixBa opened this issue Mar 14, 2018 · 2 comments · Fixed by #186
Closed

BucketName is empty #185

AlixBa opened this issue Mar 14, 2018 · 2 comments · Fixed by #186
Labels

Comments

@AlixBa
Copy link
Contributor

AlixBa commented Mar 14, 2018

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://doc.s3.amazonaws.com/2006-03-01">
  <IsTruncated>false</IsTruncated>
  <Marker/>
  <Name/>
  <Prefix/>
  <MaxKeys>1000</MaxKeys>

when using the bucketname from the ListBucketResult

java.lang.IllegalArgumentException: BucketName cannot be empty
	at com.amazonaws.util.ValidationUtils.assertStringNotEmpty(ValidationUtils.java:89)
	at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1374)
	at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1271)

regression? https://github.com/jamhall/s3rver/pull/100/files

@n1ru4l n1ru4l added the bug label Mar 14, 2018
@n1ru4l
Copy link
Collaborator

n1ru4l commented Mar 14, 2018

Seems so 😕

s3rver/lib/controllers.js

Lines 311 to 324 in d69913a

getBucket(req, res) {
if (indexDocument) {
store.getObject(req.params.bucket, indexDocument, (err, object) => {
if (!object) return errorResponse(req, res, indexDocument);
logger.info("Serving Page: %s", object.key);
buildResponse(req, res, 200, object);
});
} else {
const options = {
delimiter: req.query["delimiter"],
marker: req.query["marker"],
maxKeys: Math.min(1000, parseInt(req.query["max-keys"]) || Infinity),
prefix: req.query["prefix"]
};

@AlixBa
Copy link
Contributor Author

AlixBa commented Mar 15, 2018

Thanks @specialkk @n1ru4l :)
Reactive and efficient :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants