Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pleroma
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
406
Issues
406
List
Boards
Labels
Service Desk
Milestones
Merge Requests
59
Merge Requests
59
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pleroma
pleroma
Commits
c401b00c
Verified
Commit
c401b00c
authored
Apr 09, 2020
by
Haelwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ObjectValidators.Types.ObjectID: Fix when URI.parse returns %URL{host: ""}
parent
90cbf552
Pipeline
#24290
passed with stages
in 6 minutes and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
lib/pleroma/web/activity_pub/object_validators/types/object_id.ex
...oma/web/activity_pub/object_validators/types/object_id.ex
+4
-8
No files found.
lib/pleroma/web/activity_pub/object_validators/types/object_id.ex
View file @
c401b00c
...
...
@@ -6,14 +6,10 @@ def type, do: :string
def
cast
(
object
)
when
is_binary
(
object
)
do
# Host has to be present and scheme has to be an http scheme (for now)
case
URI
.
parse
(
object
)
do
%
URI
{
host:
nil
}
->
:error
%
URI
{
scheme:
scheme
}
when
scheme
in
[
"https"
,
"http"
]
->
{
:ok
,
object
}
_
->
:error
%
URI
{
host:
nil
}
->
:error
%
URI
{
host:
""
}
->
:error
%
URI
{
scheme:
scheme
}
when
scheme
in
[
"https"
,
"http"
]
->
{
:ok
,
object
}
_
->
:error
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment