Assert string in HTTP response header.

@Then I should see in the header :header::value
506432
public function iShouldSeeInTheHeader($header, $value) {
    $headers = $this->getSession()->getResponseHeaders();
    if ($headers[$header] != $value) {
      throw new \Exception(sprintf("Did not see %s with value %s.", $header, $value));
    }
  }
262127
private void checkHeaderValue(String data) {
        // if the last character is a CR or LF, then this fails
        int index = data.length() - 1;
        if (index < 0) {
            // empty string, quit now with success
            return;
        }
        String error = null;
        char c = data.charAt(index);
        if (BNFHeaders.LF == c || BNFHeaders.CR == c) {
            error = "Illegal trailing EOL";
        }

        // scan through the data now for invalid CRLF presence. Note that CRLFs
        // may be followed by whitespace for valid multiline headers.
        for (int i = 0; null == error && i < index; i++) {
            c = data.charAt(i);
            if (BNFHeaders.CR == c) {
                // next char must be an LF
                if (BNFHeaders.LF != data.charAt(i + 1)) {
                    error = "Invalid CR not followed by LF";
                }
            } else if (BNFHeaders.LF == c) {
                c = data.charAt(++i);
                // if it is not followed by whitespace then this value is bad
                if (BNFHeaders.TAB != c && BNFHeaders.SPACE != c) {
                    error = "Invalid LF not followed by whitespace";
                }
            }
        }

        // if we found an error, throw the exception now
        if (null != error) {
            IllegalArgumentException iae = new IllegalArgumentException(error);
            FFDCFilter.processException(iae, getClass().getName() + ".checkHeaderValue(String)", "1", this);
            throw iae;
        }
    }
643175
function assertString(attr, data) {
  if (data === null || data === undefined) {
    return null;
  }

  if (typeof data !== 'string') {
    throw new ParseError(`Attribute ${attr} must be of type "string"`);
  }

  return data;
}
216230
function(_headers,_key,_default){
            var _value = _headers[_key]||
                         _headers[_key.toLowerCase()];
            if (!_value){
                _value = _default;
                _headers[_key] = _value;
            }
            return _value;
        }
687360
function(key, value) {
          const key2 = key.toLowerCase().replace(/[^a-z0-9]/ig, '');
          res.serverassist.headers[key]    = value;
          res.serverassist.headers2[key2]  = value;
        }
1366500
public T header(Header name, String value) {
		return header(name.toString(), value, true);
	}
366601
function checkResponse(actual, expected, bindings) {

    debug('Checking response, expecting:', expected)

    addTest('Status: ' + expected.title, function() {
      assert.equal(actual.statusCode, expected.code)
    })

    for (var key in expected.headers) {
      var val = expected.headers[key]
      addTest('Header: ' + key + ': ' + val, function() {
        assert.ok(actual.headers[key], "Header " + key + " expected, but not found")
        assert.ok(interpolate.match(actual.headers[key], val, bindings), "Expected headers to match")
      })
    }

    if (expected.body) {
      assertBodyMatches(actual.body, expected.body, bindings)
    } else {
      addTest('No body', function() {
        if (actual.body) assert.fail(actual.body, '', "Expected empty body")
      })
    }
  }
567910
public T header(String name, String value) {
		return header(name, value, true);
	}
333101
public StringAssert isString() {
        Node node = assertType(STRING);
        return new StringAssert((String) node.getValue()).as("Different value found in node \"%s\"", path);
    }
1314479
def _should_sign_response_header(header_name):
    

    if header_name == _HEADER_SERVER_SIGNATURE:
        return False

    if re.match(_PATTERN_HEADER_PREFIX_BUNQ, header_name):
        return True

    return False
992493
def to_s
      string = "#{@name}"
      # If value is either nil or an empty array
      if @value.nil? || @value.is_a?(Array) && @value.size == 0
        string << " (#{@type}"
        string << "/#{@subtype}" if @subtype
        string << ')'
        string << ' [required]' if @required
      else
        if @type.eql?('Array')
          string << ' ='
          @value.each { |v| string << "\n  - #{v}" }
        else
          string << " = #{@value}"
        end
      end
      string << "\n"
    end
397603
function isTrue(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && value !== true) {
        throw ValueException.unexpectedValue(assertionTypes.IS_TRUE, value, true, message, id);
    }
}
328009
function Request_addHeader(key, value) {
        var item;
        if (Type.isString(key)) {
            key = key.toLowerCase();
            if (!Type.isString(value) && !!value && Type.isFunction(value.toString)) {
                value = value.toString();
            }
            if (Type.isString(value)) {
                if (this.hasHeader(key) && !Type.isArray(this.headers[key])) {
                    item = this.getHeader(key);
                    this.headers[key] = [];
                    this.headers[key].push(item);
                    this.headers[key].push(value);
                } else if (this.hasHeader(key) && Type.isArray(this.headers[key])) {
                    this.headers[key].push(value);
                } else {
                    this.headers[key] = value;
                }
            }
        } else {
            throw new error.HttpError(500, {
                key: key,
                value: value
            }, "Request.addHeader: Header key must be string type");
        }
    }
801409
public static void setHeader(HttpServletResponse response, String name, Object value) {
		if (value instanceof String) {
			response.setHeader(name, (String) value);
		} else if (Date.class.isAssignableFrom(value.getClass())) {
			response.setDateHeader(name, ((Date) value).getTime());
		} else if (value instanceof Integer || "int".equals(value.getClass().getSimpleName().toLowerCase())) {
			response.setIntHeader(name, (Integer) value);
		} else {
			response.setHeader(name, value.toString());
		}
	}
1146150
public HttpClientMockBuilder withHeader(String header, String value) {
        return withHeader(header, equalTo(value));
    }
430470
def read_response_headers(response)
      raw_headers = response.headers
      headers = {}
      EXCLUDE_RESPONSE_HEADER_PATTERNS.each do |pattern|
        raw_headers = raw_headers.reject { |h| h if h.starts_with? pattern }
      end
      raw_headers.each do |key, val|
        headers.merge!(cleanup_header(key) => val)
      end
      headers
    end
240160
public function header($key, $value=null,$http_response_code=null) {
        if($value) {
            $key = $key.':'.$value;
        }
        headers_sent() or header($key,true,$http_response_code);
    }