Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for pathUnescape (0.22 sec)

  1. src/cmd/go/testdata/script/bug.txt

    -- main.go --
    package main
    
    import (
    	"fmt"
    	"net/url"
    	"os"
    	"path/filepath"
    )
    
    func main() {
    	u, err := url.Parse(os.Args[1])
    	if err != nil {
    		panic(err)
    	}
    	body, err := url.PathUnescape(u.Query().Get("body"))
    	if err != nil {
    		panic(err)
    	}
    	out := filepath.Join(os.TempDir(), "browser")
    	f, err := os.Create(out)
    	if err != nil {
    		panic(err)
    	}
    	fmt.Fprintln(f, body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 21:26:10 UTC 2022
    - 963 bytes
    - Viewed (0)
  2. src/net/http/routing_tree.go

    	if c := n.multiChild; c != nil {
    		// Don't record a match for a nameless wildcard (which arises from a
    		// trailing slash in the pattern).
    		if c.pattern.lastSegment().s != "" {
    			matches = append(matches, pathUnescape(path[1:])) // remove initial slash
    		}
    		return c, matches
    	}
    	return nil, nil
    }
    
    // firstSegment splits path into its first segment, and the rest.
    // The path must begin with "/".
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 30 15:43:24 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go

    			if len(headerValue) > 0 {
    				ret = append(ret, headerValue)
    			}
    		}
    	}
    	return ret
    }
    
    func unescapeExtraKey(encodedKey string) string {
    	key, err := url.PathUnescape(encodedKey) // Decode %-encoded bytes.
    	if err != nil {
    		return encodedKey // Always record extra strings, even if malformed/unencoded.
    	}
    	return key
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 18:19:54 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  4. tests/integration/security/normalization_test.go

    	}
    	var percentEncodedCases []expect
    	for i := 1; i <= 0xff; i++ {
    		input := fmt.Sprintf("/admin%%%.2x", i)
    		output := input
    		if supportedPercentEncode(i) {
    			var err error
    			output, err = url.PathUnescape(input)
    			switch i {
    			case 0x5c:
    				output = strings.ReplaceAll(output, `\`, `/`)
    			case 0x7e:
    				output = strings.ReplaceAll(output, `%7e`, `~`)
    			}
    			if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 08 22:02:59 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  5. src/net/url/example_test.go

    	"fmt"
    	"log"
    	"net/url"
    	"strings"
    )
    
    func ExamplePathEscape() {
    	path := url.PathEscape("my/cool+blog&about,stuff")
    	fmt.Println(path)
    
    	// Output:
    	// my%2Fcool+blog&about%2Cstuff
    }
    
    func ExamplePathUnescape() {
    	escapedPath := "my%2Fcool+blog&about%2Cstuff"
    	path, err := url.PathUnescape(escapedPath)
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(path)
    
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 7.2K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/endpoints/filters/impersonation.go

    		b.WriteString("[")
    		b.WriteString(strings.Join(groups, ","))
    		b.WriteString("]")
    	}
    	return b.String()
    }
    
    func unescapeExtraKey(encodedKey string) string {
    	key, err := url.PathUnescape(encodedKey) // Decode %-encoded bytes.
    	if err != nil {
    		return encodedKey // Always record extra strings, even if malformed/unencoded.
    	}
    	return key
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 07 10:10:35 UTC 2023
    - 9.5K bytes
    - Viewed (0)
Back to top