Onebox'ing failing with 418


(RaVoR) #1

Hello,

I’ve an issue where oneboxing is not working. I always get 418 on onebox-requests. Whats wrong here?

Log-Output

Started GET "/onebox?url=https%3A%2F%2Fjamielinux.com%2Fdocs%2Fopenssl-certificate-authority%2Fintroduction.html&refresh=true" for 194.115.52.3 at 2018-01-22 07:45:09 +0000
Processing by OneboxController#show as HTML
  Parameters: {"url"=>"https://jamielinux.com/docs/openssl-certificate-authority/introduction.html", "refresh"=>"true"}
  Rendering text template
  Rendered text template (0.0ms)
Completed 418  in 5ms (Views: 1.0ms | ActiveRecord: 1.0ms)

BR,
RaVoR


(Bhanu Sharma) #2

As per wikipedia,

418 I’m a teapot (RFC 2324)

This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites.

and to my best understanding, the link isn’t oneboxing because they do not have any supported meta tags supplied. I checked the link and there were no OG tags present there.

https://jamielinux.com/docs/openssl-certificate-authority/introduction.html


(Sam Saffron) #3

It’s not failing with 418 this is just a quirk in rails logging, look at your nginx logs


(Jeff Atwood) #4

You should always check using http://iframely.com/debug but yes this one looks bereft of any opengraph or oEmbed tags.


(RaVoR) #5

So Onebox always need an opengraph or oEmbed tag? If so, is this stated somewhere in documentation?


(Mittineague) #6

You’re looking for these

http://ogp.me/
https://oembed.com/


(shahid) #7

Hi @ravor-org
How did you solve this.
I have a similar scenario, the moment i start typing something which can be taken as a URL e.g. “co.uk”, the onebox feature kicks in and tries to create a preview…

Looking at the nginx logs I can see it throws a 404 as its in a invalid URL anyway:

10.242.129.251 - - [18/Jun/2018:14:58:58 +0000] "GET /discussion/onebox?url=http%3A%2F%2Fco.uk%2F&refresh=false HTTP/1.1" 404 0 "https://mydomain/discussion/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36"

The result is that it displays a blank page and I lose my discourse page.

Anyone know how to make ONEBOX ignore the 404?