// SetExposeHeaders sets the ExposeHeaders field's value.
973721
func (s *CorsRule) SetExposeHeaders(v []*string) *CorsRule {
	s.ExposeHeaders = v
	return s
}
473581
func (s *UpdateApiKeyInput) SetExpires(v int64) *UpdateApiKeyInput {
	s.Expires = &v
	return s
}
157401
func (s *PutIntegrationResponseInput) SetResponseTemplates(v map[string]*string) *PutIntegrationResponseInput {
	s.ResponseTemplates = v
	return s
}
1034571
func (s *TestInvokeAuthorizerInput) SetHeaders(v map[string]*string) *TestInvokeAuthorizerInput {
	s.Headers = v
	return s
}
1315898
func (s *FaultRootCauseEntity) SetExceptions(v []*RootCauseException) *FaultRootCauseEntity {
	s.Exceptions = v
	return s
}
1206275
func (wfe *WebFrontEndImpl) setCORSHeaders(response http.ResponseWriter, request *http.Request, allowMethods string) {
	reqOrigin := request.Header.Get("Origin")
	if reqOrigin == "" {
		// This is not a CORS request.
		return
	}

	// Allow CORS if the current origin (or "*") is listed as an
	// allowed origin in config. Otherwise, disallow by returning
	// without setting any CORS headers.
	allow := false
	for _, ao := range wfe.AllowOrigins {
		if ao == "*" {
			response.Header().Set("Access-Control-Allow-Origin", "*")
			allow = true
			break
		} else if ao == reqOrigin {
			response.Header().Set("Vary", "Origin")
			response.Header().Set("Access-Control-Allow-Origin", ao)
			allow = true
			break
		}
	}
	if !allow {
		return
	}

	if allowMethods != "" {
		// For an OPTIONS request: allow all methods handled at this URL.
		response.Header().Set("Access-Control-Allow-Methods", allowMethods)
	}
	response.Header().Set("Access-Control-Expose-Headers", "Link, Replay-Nonce")
	response.Header().Set("Access-Control-Max-Age", "86400")
}
289484
func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSpec) (err error) {
	// set common headers
	setCommonHeaders(w)

	// Set last modified time.
	lastModified := objInfo.ModTime.UTC().Format(http.TimeFormat)
	w.Header().Set("Last-Modified", lastModified)

	// Set Etag if available.
	if objInfo.ETag != "" {
		w.Header()["ETag"] = []string{"\"" + objInfo.ETag + "\""}
	}

	if objInfo.ContentType != "" {
		w.Header().Set("Content-Type", objInfo.ContentType)
	}

	if objInfo.ContentEncoding != "" {
		w.Header().Set("Content-Encoding", objInfo.ContentEncoding)
	}

	if !objInfo.Expires.IsZero() {
		w.Header().Set("Expires", objInfo.Expires.UTC().Format(http.TimeFormat))
	}

	// Set all other user defined metadata.
	for k, v := range objInfo.UserDefined {
		if hasPrefix(k, ReservedMetadataPrefix) {
			// Do not need to send any internal metadata
			// values to client.
			continue
		}
		w.Header().Set(k, v)
	}

	var totalObjectSize int64
	switch {
	case crypto.IsEncrypted(objInfo.UserDefined):
		totalObjectSize, err = objInfo.DecryptedSize()
		if err != nil {
			return err
		}
	case objInfo.IsCompressed():
		totalObjectSize = objInfo.GetActualSize()
		if totalObjectSize < 0 {
			return errInvalidDecompressedSize
		}
	default:
		totalObjectSize = objInfo.Size
	}

	// for providing ranged content
	start, rangeLen, err := rs.GetOffsetLength(totalObjectSize)
	if err != nil {
		return err
	}

	// Set content length.
	w.Header().Set("Content-Length", strconv.FormatInt(rangeLen, 10))
	if rs != nil {
		contentRange := fmt.Sprintf("bytes %d-%d/%d", start, start+rangeLen-1, totalObjectSize)
		w.Header().Set("Content-Range", contentRange)
	}

	return nil
}
572732
func (msg *Message) SetAddressHeader(field, address, name string) {
	msg.header[field] = []string{msg.FormatAddress(address, name)}
}
754943
func (o Options) addHeaders(headers map[string][]string) {
	if o.SSE {
		headers["x-amz-server-side-encryption"] = []string{"AES256"}
	}
	if len(o.ContentEncoding) != 0 {
		headers["Content-Encoding"] = []string{o.ContentEncoding}
	}
	if len(o.CacheControl) != 0 {
		headers["Cache-Control"] = []string{o.CacheControl}
	}
	if len(o.ContentMD5) != 0 {
		headers["Content-MD5"] = []string{o.ContentMD5}
	}
	if len(o.RedirectLocation) != 0 {
		headers["x-amz-website-redirect-location"] = []string{o.RedirectLocation}
	}
	for k, v := range o.Meta {
		headers["x-amz-meta-"+k] = v
	}
}
482789
func (h *PublicPortHandler) SetExports(data []registry.ExportDetails) {
	h.exports.Set(data)
}
490157
func (e *RawV4Event) SetExtraHeadersSize(size int) error {
	newFixedSize := (size +
		sizeOfBasicV4EventHeader +
		e.fixedLengthDataSize +
		e.checksumSize)
	if size < 0 || newFixedSize > len(e.data) {
		return errors.Newf(
			"Invalid extra headers size (data size: %d basic header size: %d"+
				"fixed length data size: %d checksum size: %d input: %d)",
			len(e.data),
			sizeOfBasicV4EventHeader,
			e.fixedLengthDataSize,
			e.checksumSize,
			size)
	}
	e.extraHeadersSize = size
	return nil
}
1237031
func (s *HeadObjectOutput) SetExpires(v string) *HeadObjectOutput {
	s.Expires = &v
	return s
}
148089
func (s *CreateObjectInput) SetSchemaFacets(v []*SchemaFacet) *CreateObjectInput {
	s.SchemaFacets = v
	return s
}
1120673
func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput {
	s.Exports = v
	return s
}
419744
func (s *CreateIntegrationResponseOutput) SetResponseTemplates(v map[string]*string) *CreateIntegrationResponseOutput {
	s.ResponseTemplates = v
	return s
}
525061
func (s *ArchiveOutputSettings) SetExtension(v string) *ArchiveOutputSettings {
	s.Extension = &v
	return s
}
953005
func SetResponseHeader(key, val string) ServerResponseFunc {
	return func(ctx context.Context, w http.ResponseWriter) context.Context {
		w.Header().Set(key, val)
		return ctx
	}
}