urlhub icon indicating copy to clipboard operation
urlhub copied to clipboard

How can the copy button on the +keyword page copy https links instead of http links?

Open imayafei opened this issue 1 year ago • 3 comments

How can the copy button on the +keyword page copy https links instead of http links?

imayafei avatar Sep 19 '23 02:09 imayafei

My domain already supports https, and I opened it with an https link.

imayafei avatar Sep 19 '23 02:09 imayafei

I cannot reproduce it on my side, because my environment does not support https.

Maybe this can help

https://github.com/realodix/urlhub/blob/2204bf59be75c8281b154e9943046850557e4793/resources/views/frontend/short.blade.php#L40-L45

- data-clipboard-text="{{$url->short_url}}" 
+ data-clipboard-text="{{url($url->short_url)}}"

Reference

  • https://laravel.com/docs/10.x/urls#generating-urls

realodix avatar Sep 19 '23 07:09 realodix

Thank you for your reply, I tried your plan, it is invalid. I used another method, which is a little inelegant, but it works.

urlhub/app/Providers/AppServiceProvider.php

+ use Illuminate\Support\Facades\URL;
+ 

urlhub/app/Providers/AppServiceProvider.php

+ URL::forceScheme('https');

imayafei avatar Sep 21 '23 05:09 imayafei