-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't write from stream #173
Comments
Hello! That’s a weird issue. Thanks for the clear write up, I’ll see if I can help figure out what’s going on. All the requests look wrong, IMO. The options are fine but there should only be one of each like you stated. The PUT should be sending an octet stream, not form encoded.. so that’s a larger concern. I see you’re using Digest auth, which is super cool, but it’s brand new so I wouldn’t rule out a bug there. Perhaps it’d be best if you send me some code and I register for a trial account. Have you tried doing this from Nodejs without the proxy or browser? That’d tell a lot with regards to where the issue is. |
@perry-mitchell I have prepared full reproduction repo for you (https://github.com/armpogart/webdav-bugrepo). You just need to clone it, register for trial at https://www.bigcommerce.com/essentials/, then go to your bigcommerce dashboard Server Settings -> File Access (WebDav) to get the credentials, set them at I will greatly appreciate if you find time to help me debug the problem and find out why this great library isn't working for me. I have done maximum to get you started very quick. Thanks in advance. P.S. I haven't tried to try from NodeJS directly as I don't have an appropriate environment (I mean not local NodeJS environment to exclude also proxy, though I doubt the problem is proxy as it simply proxies all requests and the proxy implementation is also open-source - cors-anywhere). I see that doing it will help us isolate the problem more to understand whether it's the problem with BigCommerce webdav server incompatibility or something with using it from browser by wrapping it in electron-angular app or maybe proxy. |
Hi @armpogart, apologies for not coming back sooner.
Duplicate requests can be a symptom of CORS fetches (OPTIONS + real request). 401 may be an issue with the service in such a case. I'm obviously only speculating as I haven't tried with BigCommerce. I also don't have the time right now to debug this further, but for now I feel that it's an isolated issue with their platform. If you get time to try from NodeJS that'll definitely help shed some light on the issue. If I get time I'll have a crack, but I've got several ongoing high priority projects right now. |
Any luck trying this with Node rather than in the browser? It can be done with a relatively simple node script which would quickly confirm whether this is just a browser issue with the service. |
@perry-mitchell I will have a spare time coming week and will try first with node directly and also I will try again in browser without proxy this time, I've found out how I can disable web security for Electron (chromium), so to bypass the issue with localhost and CORS. I will let you know what worked and what not soon. |
Closing as this is very out of date. Let's create a new issue if the problem persists. |
I'll try to describe the issue as detailed as possible as it would be impossible to provide you DAV access to test yourself.
So I'm using your client to connect to BigCommerce WebDav server access. I use your module in electronjs application and as BigCommerce CORS doesn't allow requests from localhost (both API and DAV), I use also proxy to add CORS to the requests (self hosted https://cors-anywhere.herokuapp.com).
When I try to
createWriteStream
to write file to dav, only a 15B is written (I've checked in Cyberduck client) so the file is broken and I see one 401 Unauthorized request in network tab.In the image above you can see 4 requests with the name of the file (dsc_9913.jpg), these all are just for one
createWriteStream
, something like:2 of the requests with status 200 are
OPTIONS
requests. 2 others arePUT
requests. I'm not sure why there are 2 of each there. So the firstPUT
request fails, but second one is ok, but creates broken file (Authorization is correct, as 2nd one is ok). Below you can also see all 4 requests in their order (they have a little bit different headers somehow):I'm almost sure that proxy is ok, as it is also used with BigCommerce API (Restful) and is doing its' job.
Not sure whether it's bug or something is wrong with my setup, but will appreciate any help.
P.S. If you really need to reproduce the issue, you can register for trial account on bigcommerce website and I can provide you the source code and setup a proxy for you to try the same setup.
The text was updated successfully, but these errors were encountered: