B2G/gecko/netwerk/test/httpserver/test/test_headers.js
/**
 * Ensures that a fieldname-fieldvalue combination is a valid header.
 *
 * @param fieldName
 *   the name of the header
 * @param fieldValue
 *   the value of the header
 * @param headers
 *   an nsHttpHeaders object to use to check validity
 */
Ensures that a fieldname-fieldvalue combination is a valid header.
@param fieldName
the name of the header
@param fieldValue
the value of the header
@param headers
an nsHttpHeaders object to use to check validity
Ensures that a fieldname - fieldvalue combination is a valid header . @param fieldName the name of the header @param fieldValue the value of the header @param headers an nsHttpHeaders object to use to check validity
function assertValidHeader(fieldName, fieldValue, headers)
{
  try
  {
    headers.setHeader(fieldName, fieldValue, false);
  }
  catch (e)
  {
    do_throw("Unexpected exception thrown: " + e);
  }
}
function assertValidHeader ( fieldName , fieldValue , headers ) { try { headers . setHeader ( fieldName , fieldValue , false ) ; } catch ( e ) { do_throw ( "Unexpected exception thrown: " + e ) ; } }
Ensures that a fieldname-fieldvalue combination is a valid header.
Ensures that a fieldname - fieldvalue combination is a valid header .