The Problem
When uploading a file using the Go Blobstore API, the success path redirects to the wrong appengine module. Here is a more visual description of the problem:
http://A.my-appengine-app.com/upload
http://A.my-appengine-app.com/upload/session
/upload/session
which runs the following Go code: url, err := blobstore.UploadURL(c, "/upload/success")
http://A.my-appengine-app.com/_ah/upload/[some long hash]/
action
of a <form>
.POST
request to the URL/upload/success
This is where things get weird. In development, the server redirects to "/upload/success" in module A. In production, the server redirects to the main module, which we can call B for now. I can tell this is happening because I am getting a 404
in my web console and the logs indicate that the request is being made to module B. I've even gone so far as to explicitly pass the hostname as part of the success path (step #3), but to no effect.
Current Solution (Not Ideal)
It seems my only recourse is to define a handler in module B to handle the request as module A would. Since the goapp architecture globs all the modules together, this isn't the worst tradeoff in the world, but it's semantically wrong given that modules are supposed to be vertically independent. If anyone has any idea how to work around this, I'd be obliged. For now, I'll take the aforementioned approach.