Browse Source

Advertise supported MIME types for statuses (#2090)

closed-social-glitch-2
Vyr Cossont 1 year ago
committed by GitHub
parent
commit
c4a5e0ca0e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions
  1. +2
    -0
      app/lib/html_aware_formatter.rb
  2. +1
    -0
      app/serializers/rest/instance_serializer.rb
  3. +1
    -0
      app/serializers/rest/v1/instance_serializer.rb

+ 2
- 0
app/lib/html_aware_formatter.rb View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class HtmlAwareFormatter
STATUS_MIME_TYPES = %w(text/plain text/markdown text/html).freeze
attr_reader :text, :local, :options
alias local? local

+ 1
- 0
app/serializers/rest/instance_serializer.rb View File

@ -55,6 +55,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
max_characters: StatusLengthValidator::MAX_CHARS,
max_media_attachments: 4,
characters_reserved_per_url: StatusLengthValidator::URL_PLACEHOLDER_CHARS,
supported_mime_types: HtmlAwareFormatter::STATUS_MIME_TYPES,
},
media_attachments: {

+ 1
- 0
app/serializers/rest/v1/instance_serializer.rb View File

@ -79,6 +79,7 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer
max_characters: StatusLengthValidator::MAX_CHARS,
max_media_attachments: 4,
characters_reserved_per_url: StatusLengthValidator::URL_PLACEHOLDER_CHARS,
supported_mime_types: HtmlAwareFormatter::STATUS_MIME_TYPES,
},
media_attachments: {

Loading…
Cancel
Save