Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33103234
bare_uri.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
522 B
Referenced Files
None
Subscribers
None
bare_uri.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.EctoType.ActivityPub.ObjectValidators.BareUri
do
use
Ecto.Type
def
type
,
do
:
:string
def
cast
(
uri
)
when
is_binary
(
uri
)
do
parsed
=
URI
.
parse
(
uri
)
if
is_nil
(
parsed
.
scheme
)
do
:error
else
{
:ok
,
uri
}
end
end
def
cast
(
_
),
do
:
:error
def
dump
(
data
),
do
:
{
:ok
,
data
}
def
load
(
data
),
do
:
{
:ok
,
data
}
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Tue, Jan 20, 1:27 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
934201
Default Alt Text
bare_uri.ex (522 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment