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
370
Issues
370
List
Boards
Labels
Service Desk
Milestones
Merge Requests
54
Merge Requests
54
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
45e57dd1
Commit
45e57dd1
authored
Feb 10, 2019
by
kaniini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rich media: tighten fetching timeouts and size limits
parent
06c4935c
Pipeline
#7396
passed with stages
in 6 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
lib/pleroma/web/rich_media/parser.ex
lib/pleroma/web/rich_media/parser.ex
+8
-1
No files found.
lib/pleroma/web/rich_media/parser.ex
View file @
45e57dd1
...
...
@@ -9,6 +9,13 @@ defmodule Pleroma.Web.RichMedia.Parser do
Pleroma
.
Web
.
RichMedia
.
Parsers
.
OEmbed
]
@hackney_options
[
pool:
:media
,
timeout:
2_000
,
recv_timeout:
2_000
,
max_body:
2_000_000
]
def
parse
(
nil
),
do
:
{
:error
,
"No URL provided"
}
if
Mix
.
env
()
==
:test
do
...
...
@@ -28,7 +35,7 @@ def parse(url) do
defp
parse_url
(
url
)
do
try
do
{
:ok
,
%
Tesla
.
Env
{
body:
html
}}
=
Pleroma
.
HTTP
.
get
(
url
,
[],
adapter:
[
pool:
:media
]
)
{
:ok
,
%
Tesla
.
Env
{
body:
html
}}
=
Pleroma
.
HTTP
.
get
(
url
,
[],
adapter:
@hackney_options
)
html
|>
maybe_parse
()
|>
clean_parsed_data
()
|>
check_parsed_data
()
rescue
...
...
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