dinandmentink / nova-markdown

Adds a markdown editor component to laravel nova.
MIT License
36 stars 4 forks source link

uploading image causes (blocked:mixed-content) #31

Open danish-khan-I opened 1 year ago

danish-khan-I commented 1 year ago

Earlier I was using public as storage, this issue occurred at that time but we have fixed it forcing http to https, but recently we have switch to s3 and now it started to throw the same error, I checked the url its http instead of https. I know switch storage shouldn't be the reason but it happened anyways.

I checked the source code and saw it was using route.

or can it remove http or https from url in ajax request and only call the request starting with //

dinandmentink commented 1 year ago

Please note that nova-markdown is eol and support is minimal. https://github.com/dinandmentink/nova-markdown#eol-notice

For https requests route will also return https urls. Otherwise it's based on your APP_URL I believe. Is your env configured correctly?

I have been using this project with s3 hosting with https for a long while. So it should be possible to get it to work.

danish-khan-I commented 1 year ago

I see, can you at least make the route 'uploadEndpoint' => route('nova-markdown.uploads.store',null,false), to use relative path instead of absolute? I have tested it and it works and it should work for others as usual. I can create a PR if you think it would be good to do it.

Yes, I have seen double checked env and I have APP_URL configured correctly using https while everything works with https I only had issue with nova-markdown.

if its eol, do you recommend any other package for nova that has image upload with markdown. there are plenty for WYSIWYG but not markdown.

dinandmentink commented 1 year ago

I cannot test this setting right now and I believe this is an issue with your local configuration. So I'm going to refrain from making this change which may cause issues for other users.

route('nova-markdown.uploads.store') will return an https url if the request was performed over https. If there is no request it will be based on the APP_URL env variable.