Get name from Content-Type header
774576
def _get_name_from_content_type(self, request):
        

        content_type = request.META.get('CONTENT_TYPE', None)
        if content_type:
            # remove the possible charset-encoding info
            return util.strip_charset(content_type)
        return None
770068
def getheader(self, name, default=None):
        """"""
        return self.aiohttp_response.headers.get(name, default)
536270
protected static String getFullHeaderName(String headerName) {

		String fullName = null;
		if (JainSipUtils.HEADER_COMPACT_2_FULL_NAMES_MAPPINGS.containsKey(headerName)) {
			fullName = JainSipUtils.HEADER_COMPACT_2_FULL_NAMES_MAPPINGS.get(headerName);
		} else {
			fullName = headerName;
		}
		if (logger.isDebugEnabled())
			logger.debug("Fetching full header name for [" + headerName
					+ "] returning [" + fullName + "]");

		return fullName;
	}
843620
def normalize_header(name)
      return name if name =~ CANONICAL_NAME_RE

      normalized = name.split(/[\-_]/).each(&:capitalize!).join("-")

      return normalized if normalized =~ COMPLIANT_NAME_RE

      raise HeaderError, "Invalid HTTP header field name: #{name.inspect}"
    end
284415
def get(name)
      name = normalize_header name.to_s
      @pile.select { |k, _| k == name }.map { |_, v| v }
    end
323897
function getResponseHeader(sHeaderName) {
		var sResponseHeader;

		sHeaderName = sHeaderName.toLowerCase();

		for (sResponseHeader in this.headers) {
			if (sResponseHeader.toLowerCase() === sHeaderName) {
				return this.headers[sResponseHeader];
			}
		}
	}
551384
public function getContentTypeName($contentType)
    {
        if (!$contentType instanceof ContentType) {
            try {
                $contentType = $this->contentTypeService->loadContentType($contentType);
            } catch (NotFoundException $e) {
                return '';
            }
        }

        return $contentType->getName();
    }
471226
public String headerOut(String name)
  {
    ArrayList<String> keys = _headerKeysOut;

    int headerSize = keys.size();
    for (int i = 0; i < headerSize; i++) {
      String oldKey = keys.get(i);

      if (oldKey.equalsIgnoreCase(name)) {
        return (String) _headerValuesOut.get(i);
      }
    }

    /*
    if (name.equalsIgnoreCase("content-type")) {
      throw new UnsupportedOperationException();
      //return request().getContentType();
    }
    */

    if (name.equalsIgnoreCase("content-length")) {
      return _contentLengthOut >= 0 ? String.valueOf(_contentLengthOut) : null;
    }
    
    if (name.equalsIgnoreCase("content-type")) {
      return _contentTypeOut;
    }

    return null;
  }
1022241
public String getHeader(String name) {
        name += ":";
        for (String header : headers) {
            if (name.regionMatches(true, 0, header, 0, name.length())) {
                return header.substring(name.length()).trim();
            }
        }
        return null;
    }
455100
def _get_file_name(self, contentDisposition,
                       url, ext=".unknown"):
        
        if self.PY2:
            if contentDisposition is not None:
                return re.findall(r'filename[^;=\n]*=(([\'"]).*?\2|[^;\n]*)',
                                  contentDisposition.strip().replace('"', ''))[0][0]
            elif os.path.basename(url).find('.') > -1:
                return os.path.basename(url)
        elif self.PY3:
            if contentDisposition is not None:
                p = re.compile(r'filename[^;=\n]*=(([\'"]).*?\2|[^;\n]*)')
                return p.findall(contentDisposition.strip().replace('"', ''))[0][0]
            elif os.path.basename(url).find('.') > -1:
                return os.path.basename(url)
        return "%s.%s" % (uuid.uuid4().get_hex(), ext)
1003828
def name(self) -> Optional[str]:
        

        _, params = parse_content_disposition(
            self.headers.get(CONTENT_DISPOSITION))
        return content_disposition_filename(params, 'name')
739066
function _getName(fullname, extension) {
        return extension !== "" ? fullname.substring(0, fullname.length - extension.length - 1) : fullname;
    }
863881
def get_request_filename(request):
    ''''''
    # Check to see if a filename is specified in the HTTP headers.
    if 'Content-Disposition' in request.info():
        disposition = request.info()['Content-Disposition']
        pieces = re.split(r'\s*;\s*', disposition)
        for piece in pieces:
            if piece.startswith('filename='):
                filename = piece[len('filename='):]
                # Strip exactly one " from each end.
                if filename.startswith('"'):
                    filename = filename[1:]
                if filename.endswith('"'):
                    filename = filename[:-1]
                # Interpret backslashed quotes.
                filename = filename.replace('\\"', '"')
                return filename
    # If no filename was specified, pick a reasonable default.
    return os.path.basename(urlsplit(request.url).path) or 'index.html'
137773
def parse_headers(self, req, name, field):
        """"""
        return get_value(req.headers, name, field)
553365
def header_check(self, content):
        """"""

        encode = None

        # Look for meta charset
        m = RE_HTML_ENCODE.search(content)
        if m:
            enc = m.group(1).decode('ascii')

            try:
                codecs.getencoder(enc)
                encode = enc
            except LookupError:
                pass
        else:
            encode = self._has_xml_encode(content)
        return encode
329735
private static function getHeadersFromInput ()
	{
		// getallheaders available, use that
		if (function_exists('getallheaders')) return getallheaders();

		// getallheaders not available: manually extract 'm
		$headers = [];
		foreach ($_SERVER as $name => $value)
		{
			if (substr($name, 0, 5) == 'HTTP_') {
			    $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
				$headers[$key] = $value;
			} else if (strtolower (substr ($name, 0, 7)) == 'content') {
                $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $name))));
				$headers[$key] = $value;
			}
		}
		return $headers;
	}
1225874
def get_header_by_name(self, hdrname):
        '''
        
        '''
        for hdr in self._headers:
            if hdr.__class__.__name__ == hdrname:
                return hdr
        return None