Difference between revisions of "Adding Embed Whitelist Items"

From Dreamwidth Notes
Jump to: navigation, search
m (added in #1954)
m (more descriptiveness of work to be done)
Line 3: Line 3:
 
  cgi-bin/DW/Hooks/EmbedWhitelist.pm
 
  cgi-bin/DW/Hooks/EmbedWhitelist.pm
 
  t/embed-whitelist.t
 
  t/embed-whitelist.t
 +
 +
In the code hook, most sites can be added to <code>%host_path_match</code> with a simple regular expression to test that the URL is in the expected format.  The second argument is 1 or 0 depending on whether the site supports https connections or not - you should test this.
 +
 +
In the test suite, you'll want to add a simple check to make sure the URL you were given as a test case passes your check to be allowed on the site.  See [[Dev Testing]] for more information about setting up and running the automated tests.
  
  

Revision as of 00:05, 4 February 2017

Files you'll want to poke include:

cgi-bin/DW/Hooks/EmbedWhitelist.pm
t/embed-whitelist.t

In the code hook, most sites can be added to %host_path_match with a simple regular expression to test that the URL is in the expected format. The second argument is 1 or 0 depending on whether the site supports https connections or not - you should test this.

In the test suite, you'll want to add a simple check to make sure the URL you were given as a test case passes your check to be allowed on the site. See Dev Testing for more information about setting up and running the automated tests.


Example

Add flickr embeds to our whitelist, issue #720

Add vid.me embeds, cover the other type of flickr videos

Current Whitelisted Embeds ( as of January 2017)