UCLOrengoGroup / cath-todo

Issues relating to the CATH protein structure classification web pages
4 stars 0 forks source link

funfhmmer api: fix web page for 'check' endpoint (or improve error message when 'accept' header is missing) #33

Closed sillitoe closed 6 years ago

sillitoe commented 6 years ago

the 'check' endpoint on the CATH funfhmmer API currently requires the header accept: application/json. If this header is not present then an error is returned:

"Content-Type text/html had a problem with your request.

***ERROR*** 

Couldn't render template "search/search_sequence_funfams_results.tt: file error - search/search_sequence_results.tt: not found"

This is due to REST::ForBrowser attempting to return a web page. Either we provide a valid web page or we always render application/json.

sillitoe commented 6 years ago

Added a web page if this endpoint is viewed from a browser (ie lacks the header: accept: 'application/json')