Fix extension detection for URI with params