mirror of
https://github.com/neocities/neocities.git
synced 2025-07-04 18:13:28 +02:00
fix for api calls with square bracket filenames
This commit is contained in:
parent
3087e39b57
commit
e7e5121700
3 changed files with 30 additions and 7 deletions
|
@ -308,6 +308,15 @@ describe 'api' do
|
|||
_(site_file_exists?('test.jpg')).must_equal true
|
||||
end
|
||||
|
||||
it 'succeeds with square bracket in filename' do
|
||||
create_site
|
||||
@site.generate_api_key!
|
||||
header 'Authorization', "Bearer #{@site.api_key}"
|
||||
post '/api/upload', 'te[s]t.jpg' => Rack::Test::UploadedFile.new('./tests/files/test.jpg', 'image/jpeg')
|
||||
_(res[:result]).must_equal 'success'
|
||||
_(site_file_exists?('te[s]t.jpg')).must_equal true
|
||||
end
|
||||
|
||||
it 'succeeds with valid user session' do
|
||||
create_site
|
||||
post '/api/upload',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue