public boolean isAcceptValid ( HttpHeaders headers ) { String accept = headers . get ( HttpHeaders . Names . ACCEPT ) ; // if we get no Accept (which means */*), or */*, // or application/json, then it's valid return ( Strings . isNullOrEmpty ( accept ) || accept . contains ( ACCEPT_ALL ) || accept . toLowerCase ( ) . contains ( MEDIA_TYPE_APPLICATION_JSON ) ) ; }
Checks the Accept header to see if clients accept the correct media type