import React from 'react'; import PropTypes from 'prop-types'; import url from 'url'; export default class AppPermission extends React.Component { constructor(props) { super(props); const curl = this.getCurl(); this.state = { curl: curl, }; console.log('curl', curl); } getCurl() { const wurl = url.parse(this.props.url); let curl; let curlString; const searchParams = new URLSearchParams(wurl.search); // Return string representation of content URL without query parameters if(searchParams && searchParams.get('url')) { curl = url.parse(searchParams.get('url')); if(curl) { curl.search = curl.query = ""; curlString = curl.format(); } } if (!curl && wurl) { wurl.search = wurl.query = ""; curlString = wurl.format(); } return curlString; } render() { return (