# Pdf files on same server don't show onebox with subdomain url

**URL:** <https://meta.discourse.org/t/pdf-files-on-same-server-dont-show-onebox-with-subdomain-url/100472>\
**Category:** Product Support\
**Created:** [October 25, 2018, 4:13pm UTC](https://meta.discourse.org/t/pdf-files-on-same-server-dont-show-onebox-with-subdomain-url/100472 "2018-10-25T16:13:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rocancourt](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@Rocancourt](https://meta.discourse.org/u/Rocancourt)\
**Post date:** [October 25, 2018, 7:16pm UTC](https://meta.discourse.org/t/pdf-files-on-same-server-dont-show-onebox-with-subdomain-url/100472/2 "2018-10-25T19:16:19Z")

</div>

I have search in the code,

```
 def self.external_onebox(url)
Rails.cache.fetch(onebox_cache_key(url), expires_in: 1.day) do
  fd = FinalDestination.new(url, ignore_redirects: ignore_redirects, ignore_hostnames: blacklisted_domains, force_get_hosts: force_get_hosts)
  uri = fd.resolve
  return blank_onebox if uri.blank? || blacklisted_domains.map { |hostname| uri.hostname.match?(hostname) }.any?

  options = {
    cache: {},
    max_width: 695,
    sanitize_config: Sanitize::Config::DISCOURSE_ONEBOX
  }

  options[:cookie] = fd.cookie if fd.cookie

  if Rails.env.development? && SiteSetting.port.to_i > 0
    Onebox.options = { allowed_ports: [80, 443, SiteSetting.port.to_i] }
  end

  r = Onebox.preview(uri.to_s, options)

  { onebox: r.to_s, preview: r&.placeholder_html.to_s }
end

```

I think the problem is here, no mention for the whitelist ?

` return blank_onebox if uri.blank? || blacklisted_domains.map { |hostname| uri.hostname.match?(hostname) }.any?`

> **[pdf.pdf](https://www.pdf995.com/samples/pdf.pdf)**
>
> 423.82 KB

This link don’t work too, https can be is the problem ?

Thanks,

---

_[View the full topic](https://meta.discourse.org/t/pdf-files-on-same-server-dont-show-onebox-with-subdomain-url/100472)._
