Closed navjot50 closed 2 years ago
Hey, sorry for not getting back to you, thanks for the great PR^!
Hi Thomas. I wanted to contribute more to the library. Currently, I am unable to run the tests on my local environment. Could you tell me how to setup the local environment to run the tests?
hey, quickest way for now (how i do it) is just hosting a wordpress instance somewhere either locally (e.g. with docker) or wherever, with JWT Auth and perhaps Contact Form 7 configured as those are the plugins that are currently supported / needed. I'll try to come up with a guide how to quickly set that up using docker, but not sure when I'll find the time. My priority is currently to fix the integration tests and then get release 2.0 out of the door.
I have a suggestion for a breaking change for 2.0 release. Current implementation of library sets the mime type of a file for which it doesn't know the extension to text/plain. I recently had a situation where I had to upload .msi files to wordpress backend. If a mime type is not explicitly passed as a parameter to Media.Create method then it will set the mime type to text/plain. I think for the unrecognised extensions application/octet-stream is a more correct fit according to: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types.
This will be a breaking change as it changes the default mime type and might break uploads which were previously considered of text/plain mime type.
I can take up the changes for this and submit a new PR if you approve.
Sounds good, best to branch from my release2.0 branch and PR into that one since I just made some changes to that file.
I have renamed all the async methods with an Async suffix as per the Microsoft naming guidelines.