bool FetchUtils::isSimpleOrForbiddenRequest(const String& method, const HTTPHeaderMap& headerMap) { if (!isSimpleMethod(method)) return false; for (const auto& header : headerMap) { if (!isSimpleHeader(header.key, header.value) && !isForbiddenHeaderName(header.key)) return false; } return true; }
bool FetchUtils::isSimpleOrForbiddenRequest(const String& method, const HTTPHeaderMap& headerMap) { if (!isSimpleMethod(method)) return false; HTTPHeaderMap::const_iterator end = headerMap.end(); for (HTTPHeaderMap::const_iterator it = headerMap.begin(); it != end; ++it) { if (!isSimpleHeader(it->key, it->value) && !isForbiddenHeaderName(it->key)) return false; } return true; }
bool FetchUtils::isSimpleRequest(const String& method, const HTTPHeaderMap& headerMap) { if (!isSimpleMethod(method)) return false; for (const auto& header : headerMap) { // Preflight is required for MIME types that can not be sent via form // submission. if (!isSimpleHeader(header.key, header.value)) return false; } return true; }
bool FetchUtils::isSimpleRequest(const String& method, const HTTPHeaderMap& headerMap) { if (!isSimpleMethod(method)) return false; HTTPHeaderMap::const_iterator end = headerMap.end(); for (HTTPHeaderMap::const_iterator it = headerMap.begin(); it != end; ++it) { // Preflight is required for MIME types that can not be sent via form // submission. if (!isSimpleHeader(it->key, it->value)) return false; } return true; }
static bool canWriteHeader(const String& name, const String& value, FetchHeaders::Guard guard, ExceptionCode& ec) { if (!isValidHTTPToken(name) || !isValidHTTPHeaderValue(value)) { ec = TypeError; return false; } if (guard == FetchHeaders::Guard::Immutable) { ec = TypeError; return false; } if (guard == FetchHeaders::Guard::Request && isForbiddenHeaderName(name)) return false; if (guard == FetchHeaders::Guard::RequestNoCors && !isSimpleHeader(name, value)) return false; if (guard == FetchHeaders::Guard::Response && isForbiddenResponseHeaderName(name)) return false; return true; }