Asset name with ~ (6G Firewall - 403 error)
deeppresentation opened this issue · 3 comments
deeppresentation commented
Would it be possible to remove '~' symbol from asset name? One of my customer of wp plugin, that I sell is complaining about that. Sending an info from him:
We use a bunch of rules in .htaccess to block malicious requests. For more info, please have a look here.
One of these rules is as follow: (# 6G:[REQUEST STRINGS])
RedirectMatch 403 (?i)(~|`|<|>|:|;|,|%|\|\s|{|}|[|]||)
Thank you
swashata commented
Hello,
It surely is possible. I would greatly appreciate a PR and guide you through the process. Basically you'd want the asset name generation to be configurable here in this file
deeppresentation commented
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
-->Hello,Yes, that would be great when the asset name generation is configurable here in this file https://github.com/swashata/wp-webpack-script/blob/master/packages/scripts/src/config/WebpackConfigHelper.tsCan you give me some WhatsApp, messenger or other contact so we can communicate in more direct way so you can quide me? S pozdravem Tomáš Groulík From: Swashata GhoshSent: Sunday, December 5, 2021 7:34 AMTo: swashata/wp-webpack-scriptCc: Tomáš Groulík; AuthorSubject: Re: [swashata/wp-webpack-script] Asset name with ~ (6G Firewall - 403 error) (Issue #1243) Hello,It surely is possible. I would greatly appreciate a PR and guide you through the process. Basically you'd want the asset name generation to be configurable here in this filehttps://github.com/swashata/wp-webpack-script/blob/master/packages/scripts/src/config/WebpackConfigHelper.ts—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
Rados51 commented
You can use this inside of the wpackio.project.js
webpackConfig: (config, merge, appDir, isDev) => {
const customRule = {
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name(module, chunks, cacheGroupKey) {
if (isDev) return "vendors";
const moduleFileName = module
.identifier()
.split("/")
.reduceRight((item) => item);
const allChunksNames = chunks.map((item) => item.name).join("-");
return `${cacheGroupKey}-${allChunksNames}-${moduleFileName}`;
},
chunks: "all",
minSize: 0,
},
},
},
},
};
return merge(config, customRule);
}