[REST][Glossary] HTTP Status 404 should be returned if the language glossary does not exists.

Description

Description of problem:
HTTP status 200 (OK) is returned even if the language glossary does not exists.
404 should be returned instead.

Version-Release number of selected component (if applicable):
Zanata 3.6.1-SNAPSHOT (git-jenkins-zanata-server-github-pull-requests-3106)

How reproducible:
Always

Steps to Reproduce:
1. Assume the server does not have the glossary for locale zh-CN111
2. Run curl -v -X GET ${ZANATA_URL}rest/glossary/zh-CN111

Actual results:
< HTTP/1.1 200 OK

  • Server Apache-Coyote/1.1 is not blacklisted
    < Server: Apache-Coyote/1.1
    < Set-Cookie: JSESSIONID=va+BjCyVCl9revuKXEfhW-Pe; Path=/zanata
    < Content-Type: application/vnd.zanata.glossary+xml
    < Content-Length: 182
    < Date: Thu, 26 Mar 2015 01:17:36 GMT
    <

  • Connection #0 to host $ZANATA_URL left intact
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:glossary xmlns:ns2="http://zanata.org/namespace/api/"><source-locales/><target-locales/><glossary-entries/></ns2:glossary>

Expected results:
HTTP/1.1 404 Not Found

Additional info:
As there is no real information leak, the severity is medium.

Environment

None

Assignee

Unassigned

Reporter

Ding-Yi Chen

Labels

Tested Version/s

Components

Priority

unspecified
Configure