{{/* SPDX-License-Identifier: Apache-2.0 */}} {{/* SPDX-FileCopyrightText: 2024 s3-proxy contributors */}} {{- $root := . -}} {{- if eq (len .Entries) 0 -}} {{- include "notFoundErrorBody" . -}} {{- else -}} {{- if contains "application/json" (.Request.Header.Get "Accept") -}} [ {{- $maxLen := len $root.Entries -}} {{- range $index, $entry := $root.Entries -}} {"name": {{ $entry.Name | toJson -}} ,"etag": {{ $entry.ETag | toJson -}} ,"type": {{ $entry.Type | toJson -}} ,"size": {{ $entry.Size | toJson -}} ,"path": {{ $entry.Path | toJson -}} ,"lastModified": {{ $entry.LastModified | date "2006-01-02T15:04:05Z07:00" | toJson -}} }{{- if ne $index (sub $maxLen 1) -}},{{- end -}} {{- end -}} ] {{- else -}}

Index of {{ .Request.URL.Path }}

{{- range .Entries }} {{- end }}
Entry Size Last modified
.. - -
{{ .Name }} {{- if eq .Type "FOLDER" -}} - {{- else -}}{{ .Size | humanSize }}{{- end -}} {{ .LastModified }}
{{- end -}} {{- end -}}