MCPcopy Index your code
hub / github.com/ampproject/amphtml / getUrlMacroAllowlist_

Method getUrlMacroAllowlist_

src/service/variable-source.js:325–342  ·  view source on GitHub ↗

* For email documents, all URL macros are disallowed by default. * @return {Array |undefined} The allowlist of substitutable AMP variables * @private

()

Source from the content-addressed store, hash-verified

323 * @private
324 */
325 getUrlMacroAllowlist_() {
326 if (this.variableAllowlist_) {
327 return this.variableAllowlist_;
328 }
329
330 // Disallow all URL macros for AMP4Email format documents.
331 if (this.ampdoc.isSingleDoc()) {
332 const doc = /** @type {!Document} */ (this.ampdoc.getRootNode());
333 if (isAmp4Email(doc)) {
334 /**
335 * The allowlist of variables allowed for variable substitution.
336 * @private {?Array<string>}
337 */
338 this.variableAllowlist_ = [''];
339 return this.variableAllowlist_;
340 }
341 }
342 }
343}

Callers 2

constructorMethod · 0.95
buildExpr_Method · 0.95

Calls 3

isAmp4EmailFunction · 0.90
isSingleDocMethod · 0.45
getRootNodeMethod · 0.45

Tested by

no test coverage detected