mirror of
https://github.com/tinygo-org/net.git
synced 2026-07-26 08:18:39 +00:00
35e809e0e5
Backport upstream Go standard library changes to TinyGo's net package. Unmodified files (18) replaced directly from Go 1.26.2 source. Modified files (22) merged via 3-way diff, preserving all TinyGo netdev adaptations, TINYGO markers, and embedded-device constraints. Notable upstream changes included: - net/http: cookie handling improvements, fs enhancements, reverse proxy updates, chunked encoding fixes - net/http: ServeMux routing and pattern matching updates - net: IP parsing and MAC address handling improvements - Various doc link syntax modernization (e.g. [Dial], [Buffers]) TinyGo-only files (netdev.go, tlssock.go) unchanged. All TINYGO comment markers preserved.
30 lines
989 B
Go
30 lines
989 B
Go
// TINYGO: The following is copied and modified from Go 1.26.2 official implementation.
|
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package http
|
|
|
|
import (
|
|
"net/url"
|
|
)
|
|
|
|
// A CookieJar manages storage and use of cookies in HTTP requests.
|
|
//
|
|
// Implementations of CookieJar must be safe for concurrent use by multiple
|
|
// goroutines.
|
|
//
|
|
// The net/http/cookiejar package provides a CookieJar implementation.
|
|
type CookieJar interface {
|
|
// SetCookies handles the receipt of the cookies in a reply for the
|
|
// given URL. It may or may not choose to save the cookies, depending
|
|
// on the jar's policy and implementation.
|
|
SetCookies(u *url.URL, cookies []*Cookie)
|
|
|
|
// Cookies returns the cookies to send in a request for the given URL.
|
|
// It is up to the implementation to honor the standard cookie use
|
|
// restrictions such as in RFC 6265.
|
|
Cookies(u *url.URL) []*Cookie
|
|
}
|