Empty value for : 'Access-Control-Request-Headers' in request headers #554
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi ,
I am using this package for asynchronous file upload . I have seen the "empty value" is set for
"Access-Control-Request-Headers" in request headers . Is there any particular reason for this ?
I have searched it in package files as well, but unable to find. Can someone let me know?
Due to this empty value , I am not able to connect this package to my customized webservices for file upload . Getting error for the preflight requests.
ERROR: "
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource"
I too have the same problem.
@Manikandan-Constient Have you find out anything in code ? Actually i want to see if at code level , this value is getting set.
Hello All,
It might be the issue with the google chrome itself . You can visit the chromium site and go through the issue given below :
https://bugs.chromium.org/p/chromium/issues/detail?id=633729
Can anyone confirm from valor software team, if this blank value is being handled on server side ?
Workaround for the above issue :
You can add dummy headers in below file to avoid sending blank values in "Access-Control-Request-Headers".
file name : \ng2-file-upload-development\components\file-upload\file-uploader.class
Changes :
public options:FileUploaderOptions = {
autoUpload: false,
isHTML5: true,
filters: [],
removeAfterUpload: false,
disableMultipart: false,
headers: [{name: "dummy", value: "dummy"}]
};
It solved the problem for me . Please let me know if it's helpful for anyone.
I came across this problem as well. When posting to another site, the CORS headers are checked by the browser before deciding to allow the request. By default, it would appear that the ng2-file-upload control sends the access control header and, if your CORS headers disallow this, then you get this error.
If you don't want to send access control headers then just disable them by using
this.uploader.onAfterAddingFile = (file) => { file.withCredentials = false; };as suggested in this answer.