src/Graviton/RestBundle/Listener/LinkHeaderResponseListener.php
private function addCommonHeaders(Request $request, Response $response)
    {
        // replace content-type if a schema was requested
        if ($request->attributes->get('schemaRequest')) {
            $response->headers->set('Content-Type', 'application/schema+json');
        }

        if ($request->attributes->has('recordCount')) {
            $response->headers->set(
                'X-Record-Count',
                (string) $request->attributes->get('recordCount')
            );
        }

        // search source header?
        if ($request->attributes->has('X-Search-Source')) {
            $response->headers->set(
                'X-Search-Source',
                (string) $request->attributes->get('X-Search-Source')
            );
        }
    }
private function addCommonHeaders(Request $request, Response $response)
    {
        // replace content-type if a schema was requested
        if ($request->attributes->get('schemaRequest')) {
            $response->headers->set('Content-Type', 'application/schema+json');
        }

        if ($request->attributes->has('recordCount')) {
            $response->headers->set(
                'X-Record-Count',
                (string) $request->attributes->get('recordCount')
            );
        }

        // search source header?
        if ($request->attributes->has('X-Search-Source')) {
            $response->headers->set(
                'X-Search-Source',
                (string) $request->attributes->get('X-Search-Source')
            );
        }
    }
private function addCommonHeaders ( Request $ request , Response $ response ) { // replace content-type if a schema was requested if ( $ request -> attributes -> get ( 'schemaRequest' ) ) { $ response -> headers -> set ( 'Content-Type' , 'application/schema+json' ) ; } if ( $ request -> attributes -> has ( 'recordCount' ) ) { $ response -> headers -> set ( 'X-Record-Count' , ( string ) $ request -> attributes -> get ( 'recordCount' ) ) ; } // search source header? if ( $ request -> attributes -> has ( 'X-Search-Source' ) ) { $ response -> headers -> set ( 'X-Search-Source' , ( string ) $ request -> attributes -> get ( 'X-Search-Source' ) ) ; } }
add common headers

@param Request  $request  request
@param Response $response response

@return void
add common headers