-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I am trying to set cache control, but it's not working
my bucket cors.
[
{
"origin": ["*"],
"responseHeader": ["Content-Type", "access-control-allow-origin","Authorization", "Cache-Control"],
"method": ["GET", "HEAD", "DELETE", "PUT", "POST"],
"maxAgeSeconds": 3600
}
]
I tried to set the cache-control while getting signed URL but then the image is not uploading.
Here is my front-end code
here using /api/product/image i am getting the singed URL and then pushing the image
axios.get(`/api/product/image`, {
params: {
fileName: newImage.file.name
}
}).then((result) => {
let imageForm = result.data
let data = new FormData();
data.append("key", imageForm.key);
data.append("bucket", imageForm.bucket);
data.append("GoogleAccessId", imageForm.GoogleAccessId);
data.append("signature", imageForm.signature);
data.append("policy", imageForm.policy);
data.append("content-type", imageForm["Content-Type"]);
data.append("file", newImage.file);
let config = {
headers: {
'Content-Type': 'multipart/form-data',
'Access-Control-Allow-Origin': '*'
}
}
axios.post("https://" + imageForm.bucket + ".storage.googleapis.com",
data, config).then((gresult) =>
If I set cache-control here in the headers field, then it's not working.
A StackOverflow question asking the similar problem, still unresolved
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels