Node.js on OpenShift: Apache returns 404 for URLs with percent-encoded '/' characters -


i have simple node.js blog system running on openshift. when reads metadata blog entry, saves title after passing through encodeuricomponent. percent-encoded string used post "key" in url.

for example:

  • i write blog post, titled "post/with/slashes"
  • my blogging system reads title metadata, , saves blog post udner "post%2fwith%2fslahes"
  • my loving readers go my-blog.io/post/post%2fwith%2fslahes in web browsers

i'm using express, , first of noticed express decodes url string before passing app (that is, code finds string "post/with/slashes" in request parameters). pass through encodeuricomponent again before looking post. don't think that's relevant, i've mentioned in case.

my problem: when run local instance (this "standalone" node.js, no apache going on), works fine. express passes me "post/with/slashes", pass string through encodeuricomponent , post. when deploy openshift, request not reach app @ all. served openshift's default 404 page, says "the requested url /post/post/with/slashes not found on server."

in summary: looks apache decoding percent-encoded url before passing node.js. since there slashes in url, express doesn't know how route request app. expected (and if why)? if not, why might happening , it?


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -