PathwayCommons / cpath2

Biological pathway data integration and access platform (Pathway Commons)
http://www.pathwaycommons.org/pc2/
MIT License
6 stars 5 forks source link

Wrong HTTP response code: 500 is returned instead expected 452, 460 #249

Closed IgorRodchenkov closed 6 years ago

IgorRodchenkov commented 8 years ago

A (intentionally bad) query, http://beta.pathwaycommons.org/pc2/search, using a browser, gets expected "452" error.

But when I run the same query with cpath-client or e.g., using CURL tool:

curl -X POST -o /dev/null --silent --head --write-out '%{http_code}\n' "http://beta.pathwaycommons.org/pc2/search"

Whereas, -

curl -X POST -o /dev/null --silent --head --write-out '%{http_code}\n' "http://<host>:<port>/pc2/search"

("GET" queries return the same responses, i.e., with/out "-X POST" - does not matter.)

Seems our lab's Apache is to blame (not the proxy or apps on the host machine).

IgorRodchenkov commented 7 years ago

Let's stop using "452", "460" status codes. In the next version, we'd send "400" (bad request) or empty/trivial content (empty BioPAX model, XML search result without any hits, empty string for SIF, etc.) instead of "452" or "460", respectively.