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

Why the code forces the user to define "redirectUrlTemplate"? #9

Open
vitorbaptista opened this issue May 7, 2016 · 2 comments
Open

Comments

@vitorbaptista
Copy link

I'm still learning my way around S3, but it doesn't seem that success_action_redirect is required, right? However, if I don't define it or a redirectUrlTemplate, the code fails with:

/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/mpbasic/index.js:297
          throw _err;
          ^

ENOREDIR: You have to define a `redirectUrlTemplate` as config or `.create()` option.
    at AwsS3Form.Basic._handleError (/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/mpbasic/index.js:275:18)
    at AwsS3Form._handleError (/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/mpbasic/index.js:4:59)
    at AwsS3Form._redirectUrl (/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/aws-s3-form/lib/aws-s3-form.js:323:21)
    at AwsS3Form._redirectUrl (/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/aws-s3-form/lib/aws-s3-form.js:3:59)
    at AwsS3Form.policy (/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/aws-s3-form/lib/aws-s3-form.js:213:78)
    at AwsS3Form.policy (/home/vitor/Projetos/okfn/opentrials/opentrials/node_modules/aws-s3-form/lib/aws-s3-form.js:3:59)
    at Object.<anonymous> (/home/vitor/Projetos/okfn/opentrials/opentrials/foo.js:15:22)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
@mpneuried
Copy link
Owner

Hi,i checked the code again.
Since Version 0.3.x the redirect url is no longer required.
See dc326ab
Instead there is a fallback to success_action_status with code 204.
But the option redirectUrlTemplate has to be undefined or null.
You can also define your prefered successActionStatus value.

Which version do you use?
FYI: I updated the module to version 0.3.4 with updated dependencies.

To play with the uploader you can clone the repo and start the testserver.
See the optimized docs

@mpneuried mpneuried self-assigned this May 9, 2016
@mpneuried
Copy link
Owner

Does this help to solve your problem?

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

No branches or pull requests

2 participants