Oneboxing doesn't work in a certain system


#1

I noticed this as one of my forum writers sent links to our forum. The problem includes PDF links that are shown as 0 KB and don’t work. (At least this is how they show on my forum.) Some links to the PDF’s simply don’t work (i.e. don’t onebox) at all. The links to the PDF files are taken from here. But the Onebox links don’t work, see below:

http://sakasti.evl.fi/sakasti.nsf/0/DA1B501CC09E109FC22577AE002A3DD8/$FILE/Church%20Communion%20Statement%20ELCF%20Bishops’%20Conference%205th%20April%202017.pdf


Here’s how it shows on my forum:


#2

Is this because of the spaces %20 in the links?


(Jeff Atwood) #3

Possibly, as I recall this is @techapj’s code so he can take a peek


(Arpit Jalan) #4

I looked into it and all the links are giving 400 Bad Request as response, so oneboxing is broken.

I tried to fetch one of the file via wget, and I got 400 Bad Request error:

➜  wget http://sakasti.evl.fi/sakasti.nsf/0/DA1B501CC09E109FC22577AE002A3DD8/$FILE/The%20Response%20of%20ELCF%20to%20the%20LWF%20study%20document%20The%20Self-Understanding%20of%20the%20Lutheran%20Communion.pdf
--2017-07-29 23:22:05--  http://sakasti.evl.fi/sakasti.nsf/0/DA1B501CC09E109FC22577AE002A3DD8//The%20Response%20of%20ELCF%20to%20the%20LWF%20study%20document%20The%20Self-Understanding%20of%20the%20Lutheran%20Communion.pdf
Resolving sakasti.evl.fi (sakasti.evl.fi)... 195.236.185.76, 195.236.185.83
Connecting to sakasti.evl.fi (sakasti.evl.fi)|195.236.185.76|:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
2017-07-29 23:22:06 ERROR 400: Bad Request.

Not sure if we can do anything here to rescue from 400 Bad Request error.


(Stephen Chung) #5

Testing PDF…

PDFtest.pdf (142.3 KB)

Nope. It is not OneBox’ed.


(Jeff Atwood) #6

It’s not supposed to be, opening a PDF is a bag of super heavy dependencies and vulnerabilities — pain.

Oh wait maybe you mean the simple file name and file size onebox. Sure @techAPJ can have a look.


(Stephen Chung) #7

Yup. That’s what I mean. The simple box with the file name and the size… Technically speaking the current download link format has all the same information, but the OneBox looks nicer… :grin:


(Arpit Jalan) #8

Oneboxing of PDF is supported for links/urls only, not for uploaded PDF attachments.


(David Taylor) #9

There’s nothing stopping the onebox system from accessing an uploaded file, so a workaround is to take the link to the uploaded file and stick it on a line by itself:


(Stephen Chung) #10

OK… so it looks like it is only OneBox-ing a standard URL that points to a PDF.

Not for the <a class="attachment"></a> tags that got generated for uploaded PDF content.