Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
9fbcdc15
Commit
9fbcdc15
authored
Apr 13, 2021
by
feld
Browse files
Validate custom instance thumbnail set via AdminAPI produces correct URL
parent
0feafcc2
Pipeline
#35814
passed with stages
in 8 minutes and 18 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
9fbcdc15
...
...
@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
-
Try to save exported ConfigDB settings (migrate_from_db) in the system temp directory if default location is not writable.
-
Uploading custom instance thumbnail via AdminAPI/AdminFE generated invalid URL to the image
## [2.3.0] - 2020-03-01
...
...
test/pleroma/web/admin_api/controllers/config_controller_test.exs
View file @
9fbcdc15
...
...
@@ -1410,6 +1410,48 @@ test "enables the welcome messages", %{conn: conn} do
"need_reboot"
=>
false
}
end
test
"custom instance thumbnail"
,
%{
conn:
conn
}
do
clear_config
([
:instance
])
params
=
%{
"group"
=>
":pleroma"
,
"key"
=>
":instance"
,
"value"
=>
[
%{
"tuple"
=>
[
":instance_thumbnail"
,
"https://example.com/media/new_thumbnail.jpg"
]
}
]
}
res
=
assert
conn
|>
put_req_header
(
"content-type"
,
"application/json"
)
|>
post
(
"/api/pleroma/admin/config"
,
%{
"configs"
=>
[
params
]})
|>
json_response_and_validate_schema
(
200
)
assert
res
==
%{
"configs"
=>
[
%{
"db"
=>
[
":instance_thumbnail"
],
"group"
=>
":pleroma"
,
"key"
=>
":instance"
,
"value"
=>
params
[
"value"
]
}
],
"need_reboot"
=>
false
}
assert
res
=
conn
|>
get
(
"/api/v1/instance"
)
|>
json_response_and_validate_schema
(
200
)
assert
res
=
%{
"thumbnail"
=>
"https://example.com/media/new_thumbnail.jpg"
}
end
end
describe
"GET /api/pleroma/admin/config/descriptions"
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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