-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: discussionA general discussion issueA general discussion issue
Description
Describe the bug
when the strapi version is: 3.0.0-beta.13,
the /upload respnse is
[
{
"id": 1875,
"name": "RjQkhE3OsrVv7uz.png",
"hash": "b2c665392e044e7fb81019df4d4cd035",
"sha256": "kfiz-6Iuc-Pcn3OCDn-Co1xCd9ieemgxSF56LYGqC5M",
"ext": ".png",
"mime": "image/png",
"size": "222.58",
"url": "/uploads/b2c665392e044e7fb81019df4d4cd035.png",
"provider": "local",
"provider_metadata": null,
"created_at": "2019-12-21T14:36:17.716Z",
"updated_at": "2019-12-21T14:36:17.716Z",
"related": []
}
]but when I upgrade the strapi version to 3.0.0-beta.17.8
the /upload response is
[
{
"id": 1875,
"name": "RjQkhE3OsrVv7uz.png",
"hash": "b2c665392e044e7fb81019df4d4cd035",
"sha256": "kfiz-6Iuc-Pcn3OCDn-Co1xCd9ieemgxSF56LYGqC5M",
"ext": ".png",
"mime": "image/png",
"size": "222.58",
"url": "http://localhost:1337/uploads/b2c665392e044e7fb81019df4d4cd035.png",
"provider": "local",
"provider_metadata": null,
"created_at": "2019-12-21T14:36:17.716Z",
"updated_at": "2019-12-21T14:36:17.716Z",
"related": []
}
]Steps to reproduce the behavior
1. upload image then get http://localhost:1337/uploads/xxx.png
git clone https://github.com/ly525/luban-h5cd back-end/h5-api && yarn && yarn dev- visit http://localhost:1337/admin/
- upload image from the admin panel
- you will see the image url is
http://localhost:1337/uploads/xxx.png
2. upload image then get /uploads/xxx.png
git checkout fad25b8# the strapi dependencies is beta.13 in this commit- rm -rf node_modules && yarn && yarn dev
- visit http://localhost:1337/admin/
- upload image from the admin panel
- you will see the image url is
http://localhost:1337/uploads/xxx.png
Expected behavior
-
this breaks my online product and makes me confused.
-
I do not want to config proxy in server.json and want to get
{url: '/uploads/xxx.png'}, could you please do not add the host prefix url to the image url, because:- the host domain may change(many customers may use my product powered by strapi and they have their domain
- we will save the image url to the database.
-
Can strapi provide an option to keep the relative image path as before)
-
may you please revert to
{url: '/uploads/xxx.png'}? thanks a lot!
Code snippets
If applicable, add code samples to help explain your problem.
System
- Node.js version: v12.13.0
- NPM version: 6.12.0
- Strapi version: 3.0.0-beta.17.8
- Database: sqlite3
- Operating system: Mac & Centos7
Metadata
Metadata
Assignees
Labels
issue: discussionA general discussion issueA general discussion issue

