liuzhe02 / bigbluebutton

Automatically exported from code.google.com/p/bigbluebutton
0 stars 0 forks source link

When using preupload slide url in create request, http redirects are not followed. #1815

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you send a create request to BigBlueButton with a preupload slides document 
like the following:

<?xml version="1.0" encoding="UTF-8"?> 
<modules> 
    <module name="presentation"> 
        <document url="http://example.com/sample.pdf" /> 
    </module> 
</modules>

and the url given is an HTTP redirect (for example, HTTP codes 301, 302, 307), 
BigBlueButton does not follow the redirect. Instead it saves the contents of 
the redirect page, which is often an html or plain text message automatically 
generated from the server.

The result is a corrupted slide which does not display properly and may prevent 
recording processing.

Ideally, BigBlueButton should follow redirects on the preupload slide url.

Original issue reported on code.google.com by calvin.walton@kepstin.ca on 14 Oct 2014 at 4:13

GoogleCodeExporter commented 9 years ago
Here's a possible way to follow redirect.
http://www.mkyong.com/java/java-httpurlconnection-follow-redirect-example/

And use org.apache.commons.io.FileUtils.copyURLToFile(URL, File) to save the 
file.

http://stackoverflow.com/questions/921262/how-to-download-and-save-a-file-from-i
nternet-using-java

Original comment by ritza...@gmail.com on 21 Oct 2014 at 7:36

GoogleCodeExporter commented 9 years ago
https://github.com/bigbluebutton/bigbluebutton/blob/master/bigbluebutton-web/gra
ils-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy#L1759

Check if URL redirects and follow redirect if it does.

Check response if 200 then download the file.

Original comment by ritza...@gmail.com on 21 Oct 2014 at 7:40

GoogleCodeExporter commented 9 years ago
Fixed in 
https://github.com/bigbluebutton/bigbluebutton/commit/9effb009d0cf84b1b2a6946d74
647941e48002f9

Original comment by ritza...@gmail.com on 23 Oct 2014 at 7:07