We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think this is a bug in the reverse lookup with "/". If I change the binding to {action: "/someAction" } it works as expected.
var {Application} = require("stick"); var {redirectTo} = require("stick/helpers"); var log = require("ringo/logging").getLogger(module.id); var fs = require("fs"); var app = exports.app = Application(); var response = require("ringo/jsgi/response"); app.configure("params", "upload", "route"); app.post("/uploadImage", function(req) { if (req.postParams.formFileInput && req.postParams.formFileInput.value.length > 0) { fs.write(module.resolve("files/" + req.postParams.formFileInput.filename), req.postParams.formFileInput.value); // This redirects to http://localhost:8080/upload/_/_(unknown_route) return redirectTo(app, { action: "/" // <----- FAILS with: Error: Unhandled request (stick/lib/stick.js#193) }); } return response.html("<html><body><h1>Upload failed.</h1></body></html>"); }); app.get("/", function(req) { return response.html("<html><head><title>File Upload Demo</title></head> \ <body><form method='POST' action='uploadImage' enctype='multipart/form-data'> \ <h1>Upload:</h1> \ <input type='file' name='formFileInput' /><hr/><input type='submit' value='Upload' /> \ </form></body> \ </html>"); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I think this is a bug in the reverse lookup with "/". If I change the binding to {action: "/someAction" } it works as expected.
The text was updated successfully, but these errors were encountered: