Documentation
¶
Overview ¶
Package url provides the /api/url endpoint for URL preview.
Index ¶
Constants ¶
const MaxPreviewURLBytes = 4096
MaxPreviewURLBytes is the longest `url` the preview endpoint accepts.
ブラウザが扱う URL の上限 (概ね 2KiB〜8KiB) に収まり、抽出した URL を切る 2048 バイト (parser) より少し広い。LRU の 1 件あたりの上限でもある。
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles the URL preview endpoint.
func NewHandler ¶
func NewHandler(fetcher *urlpreview.Fetcher, entityPacker *entity.Packer) *Handler
NewHandler creates a new URL preview handler. entityPacker is the Packer this Handler packs entities with (#3798); 無いとプレビューの画像の URL を media proxy に通さずに返すので、構築子の必須の引数で受ける (#3823)。