@@ -95,11 +95,12 @@ export function prepareRequestOptions(request_options, options) {
9595
9696 var proxy = ( options && options . proxy ) || getCustomProxyForUri ( uri , options ) ;
9797 if ( proxy ) {
98- if ( proxy . prerender && CONFIG . PRERENDER_URL && ! options ?. prevent_prerender ) {
98+ if ( proxy . prerender && CONFIG . PRERENDER_URL && options ?. allowPrerender ) {
9999 request_options . uri = CONFIG . PRERENDER_URL + encodeURIComponent ( uri ) ;
100100
101- if ( proxy . prerender === 'iframes' ) {
102- request_options . uri += ( request_options . uri . indexOf ( '?' ) > - 1 ? '&' : '?' ) + 'allow=iframes' ;
101+ // Use string `proxy.prerender` as additional prerender param.
102+ if ( typeof proxy . prerender === 'string' ) {
103+ request_options . uri += ( request_options . uri . indexOf ( '?' ) > - 1 ? '&' : '?' ) + `prerender=${ proxy . prerender } ` ;
103104 }
104105
105106 } else if ( proxy . proxy && CONFIG . PROXY_URL ) {
@@ -283,8 +284,7 @@ var getHead = function(url, options, callbacks) {
283284 follow : follow
284285 // No abort controller for head.
285286 } , {
286- ...options ,
287- prevent_prerender : true
287+ ...options
288288 } ) ;
289289
290290 try {
@@ -633,7 +633,7 @@ export function findMainLdObjectWithVideo(ld) {
633633 }
634634
635635 getUrlFunctional ( uri , {
636- prevent_prerender : true ,
636+
637637 timeout : options . timeout || CONFIG . RESPONSE_TIMEOUT ,
638638 asBuffer : true
639639 } , {
@@ -823,8 +823,7 @@ export function getContentType(uriForCache, uriOriginal, options, cb) {
823823 var methodCaller = method && method === 'GET' ? getUrlFunctional : getHeadFunctional ;
824824
825825 methodCaller ( uri , {
826- timeout : options . timeout || CONFIG . RESPONSE_TIMEOUT ,
827- prevent_prerender : true
826+ timeout : options . timeout || CONFIG . RESPONSE_TIMEOUT
828827 } , {
829828 onResponse : function ( res , request_options ) {
830829
@@ -1239,8 +1238,6 @@ var getUriStatusPrivate = function(uri, options, cb) {
12391238 } ,
12401239 timeout : options . timeout || CONFIG . RESPONSE_TIMEOUT ,
12411240 follow : CONFIG . MAX_REDIRECTS
1242- } , {
1243- prevent_prerender : true
12441241 } ) ;
12451242
12461243 try {
0 commit comments