Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for TrimString (0.17 sec)

  1. src/net/http/cookie.go

    func ParseSetCookie(line string) (*Cookie, error) {
    	parts := strings.Split(textproto.TrimString(line), ";")
    	if len(parts) == 1 && parts[0] == "" {
    		return nil, errBlankCookie
    	}
    	parts[0] = textproto.TrimString(parts[0])
    	name, value, ok := strings.Cut(parts[0], "=")
    	if !ok {
    		return nil, errEqualNotFoundInCookie
    	}
    	name = textproto.TrimString(name)
    	if !isCookieNameValid(name) {
    		return nil, errInvalidCookieName
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 18:33:05 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  2. src/net/textproto/textproto.go

    	id = c.Next()
    	c.StartRequest(id)
    	err = c.PrintfLine(format, args...)
    	c.EndRequest(id)
    	if err != nil {
    		return 0, err
    	}
    	return id, nil
    }
    
    // TrimString returns s without leading and trailing ASCII space.
    func TrimString(s string) string {
    	for len(s) > 0 && isASCIISpace(s[0]) {
    		s = s[1:]
    	}
    	for len(s) > 0 && isASCIISpace(s[len(s)-1]) {
    		s = s[:len(s)-1]
    	}
    	return s
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  3. src/net/http/httptest/recorder.go

    	if trailers, ok := rw.snapHeader["Trailer"]; ok {
    		res.Trailer = make(http.Header, len(trailers))
    		for _, k := range trailers {
    			for _, k := range strings.Split(k, ",") {
    				k = http.CanonicalHeaderKey(textproto.TrimString(k))
    				if !httpguts.ValidTrailerHeader(k) {
    					// Ignore since forbidden by RFC 7230, section 4.1.2.
    					continue
    				}
    				vv, ok := rw.HeaderMap[k]
    				if !ok {
    					continue
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 7K bytes
    - Viewed (0)
  4. src/net/http/fs.go

    	noOverlap := false
    	for _, ra := range strings.Split(s[len(b):], ",") {
    		ra = textproto.TrimString(ra)
    		if ra == "" {
    			continue
    		}
    		start, end, ok := strings.Cut(ra, "-")
    		if !ok {
    			return nil, errors.New("invalid range")
    		}
    		start, end = textproto.TrimString(start), textproto.TrimString(end)
    		var r httpRange
    		if start == "" {
    			// If no start is specified, end specifies the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 17:06:47 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  5. internal/logger/logger.go

    	trimStrings = append(trimStrings, filepath.Join("github.com", "minio", "minio")+string(filepath.Separator))
    }
    
    func trimTrace(f string) string {
    	for _, trimString := range trimStrings {
    		f = strings.TrimPrefix(filepath.ToSlash(f), filepath.ToSlash(trimString))
    	}
    	return filepath.FromSlash(f)
    }
    
    func getSource(level int) string {
    	pc, file, lineNumber, ok := runtime.Caller(level)
    	if ok {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 12.4K bytes
    - Viewed (0)
  6. src/cmd/vendor/rsc.io/markdown/code.go

    	case '`', '~':
    		f := t.string()
    		n := 0
    		for i := 0; ; i++ {
    			if !t.trim(c) {
    				if i >= 3 {
    					break
    				}
    				return false
    			}
    			n++
    		}
    		txt := mdUnescaper.Replace(t.trimString())
    		if c == '`' && strings.Contains(txt, "`") {
    			return false
    		}
    		txt = trimSpaceTab(txt)
    		*info = txt
    
    		*fence = f[:n]
    		*s = line{}
    		return true
    	}
    	return false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  7. src/net/http/header.go

    			// way to provide the error back to the server
    			// handler, so just drop invalid headers instead.
    			continue
    		}
    		for _, v := range kv.values {
    			v = headerNewlineToSpace.Replace(v)
    			v = textproto.TrimString(v)
    			for _, s := range []string{kv.key, ": ", v, "\r\n"} {
    				if _, err := ws.WriteString(s); err != nil {
    					headerSorterPool.Put(sorter)
    					return err
    				}
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  8. src/net/http/transfer.go

    		// Content-Length headers if they differ in value.
    		// If there are dups of the value, remove the dups.
    		// See Issue 16490.
    		first := textproto.TrimString(contentLens[0])
    		for _, ct := range contentLens[1:] {
    			if first != textproto.TrimString(ct) {
    				return 0, fmt.Errorf("http: message cannot contain multiple Content-Length headers; got %q", contentLens)
    			}
    		}
    
    		// deduplicate Content-Length
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  9. src/net/http/cgi/host.go

    			h.printf("cgi: bogus header line: %s", line)
    			continue
    		}
    		if !httpguts.ValidHeaderFieldName(header) {
    			h.printf("cgi: invalid header name: %q", header)
    			continue
    		}
    		val = textproto.TrimString(val)
    		switch {
    		case header == "Status":
    			if len(val) < 3 {
    				h.printf("cgi: bogus status (short): %q", val)
    				return
    			}
    			code, err := strconv.Atoi(val[0:3])
    			if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  10. src/cmd/vendor/rsc.io/markdown/parse.go

    }
    
    func (s *line) eof() bool {
    	return s.i >= len(s.text)
    }
    
    func (s *line) trimSpaceString() string {
    	return trimLeftSpaceTab(s.text[s.i:])
    }
    
    func (s *line) trimString() string {
    	return trimSpaceTab(s.text[s.i:])
    }
    
    func ToHTML(b Block) string {
    	var buf bytes.Buffer
    	b.PrintHTML(&buf)
    	return buf.String()
    }
    
    func ToMarkdown(b Block) string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 13.8K bytes
    - Viewed (0)
Back to top