Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for hexEscapeNonASCII (0.16 sec)

  1. src/net/http/http_test.go

    	}
    }
    
    const redirectURL = "/thisaredirect细雪withasciilettersのけぶabcdefghijk.html"
    
    func BenchmarkHexEscapeNonASCII(b *testing.B) {
    	b.ReportAllocs()
    
    	for i := 0; i < b.N; i++ {
    		hexEscapeNonASCII(redirectURL)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 18:18:19 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  2. src/net/http/http.go

    func stringContainsCTLByte(s string) bool {
    	for i := 0; i < len(s); i++ {
    		b := s[i]
    		if b < ' ' || b == 0x7f {
    			return true
    		}
    	}
    	return false
    }
    
    func hexEscapeNonASCII(s string) string {
    	newLen := 0
    	for i := 0; i < len(s); i++ {
    		if s[i] >= utf8.RuneSelf {
    			newLen += 3
    		} else {
    			newLen++
    		}
    	}
    	if newLen == len(s) {
    		return s
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  3. src/net/http/server.go

    	// the response because older user agents may not understand 301/307.
    	// Do it only if the request didn't already have a Content-Type header.
    	_, hadCT := h["Content-Type"]
    
    	h.Set("Location", hexEscapeNonASCII(url))
    	if !hadCT && (r.Method == "GET" || r.Method == "HEAD") {
    		h.Set("Content-Type", "text/html; charset=utf-8")
    	}
    	w.WriteHeader(code)
    
    	// Shouldn't send the body for POST or HEAD; that leaves GET.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
Back to top