function Which([string] $cmd) {
$path = (($Env:Path).Split(";") | Select -uniq | Where { $_.Length } | Where { Test-Path $_ } | Get-ChildItem -filter $cmd).FullName
if ($path) { $path.ToString() }
}
# check if Chocolatey is installed
if (Which('cinst.bat')) {
Write-Host "yes"
} else {
Write-Host "no"
}
Или эту версию, вызывая команду оригинала где. Эта версия также работает лучше, потому что не ограничивается файлами bat
function which([string] $cmd) {
$where = iex $(Join-Path $env:SystemRoot "System32\where.exe $cmd 2>&1")
$first = $($where -split '[\r\n]')
if ($first.getType().BaseType.Name -eq 'Array') {
$first = $first[0]
}
if (Test-Path $first) {
$first
}
}
# check if Curl is installed
if (which('curl')) {
echo 'yes'
} else {
echo 'no'
}
Просто отключите Spring Security в SecurityConfiguration
для всех запросов:
@Override
public void configure(WebSecurity web) {
web
.ignoring()
.antMatchers("/**");
}
В качестве альтернативы вы можете сделать это более детально для любого метода HTTP:
@Override
public void configure(WebSecurity web) {
web
.ignoring()
.antMatchers(HttpMethod.OPTIONS)
.antMatchers(HttpMethod.TRACE)
.antMatchers(HttpMethod.PATCH)
.antMatchers(HttpMethod.PUT)
.antMatchers(HttpMethod.POST)
.antMatchers(HttpMethod.GET);
}
Для Для дальнейшей тонкой настройки вы также можете обратиться к документации по этой теме
blockquote>