...negatives and will bypass checks wrongly Remember to always be explicit (like using ??) or enable strict-boolean-expressions to avoid the falsey trap && for non-null access Returns the first...

...and what you're actually checking for: return n !== undefined ? n : 1; Option 2: Enable strict-boolean-expressions (recommended) The @typescript-eslint/strict-boolean-expressions rule forbids non-boolean types in boolean...

Given you have a strict CSP that only allows...

web.archive.org

Rails 6.1 has a "strict loading" mode that forces the developer to preload any association they plan to use. Associations no longer load lazily. An error is raised when reading...

...an association that was not preloaded. Enabling strict loading is a tool to prevent n+1 queries. Strict loading can be enabled for individual records, for a single association, for...

content-security-policy.com

The strict-dynamic source list keyword allows you to simplify your CSP policy by favoring hashes and nonces over domain host lists. The key super power of strict...

...script can be made backwards compatible by doing something like this: script-src 'nonce-rAnd0m' 'strict-dynamic' https: 'self' default-src 'self'; With 'strict-dynamic' the https: entry will be...

In Rails 7.1 it has become possible to annotate partials with the locals they expect: # partial _user_name.erb <%# locals: (user:) %>

...while keeping pragmatic defaults for styles, images, etc. This CSP does not use the viral strict-dynamic source (reasoning). We also have a very compatible CSP which is more liberal...

...await fetch('/page') let html = await response.text() document.querySelector('#content').innerHTML = html Now the virality of strict-dynamic allows the attacker script to run, bypassing the intent of your CSP...

makandra dev

...Chrome default, gradually rolled out) is an even better default for cookies. Set SameSite=Strict only for extra security in special cases (see below). If your application is rendered in...

...iframe, image requests etc. It saves the user from cross-site request forgery. SameSite=Strict Only send the cookie if the request was initiated from the cookie domain. The cookie...

policy.object_src :none policy.script_src :unsafe_eval, :strict_dynamic, :https # Browsers with support for "'strict-dynamic'" will ignore "https:" policy.base_uri :self # policy.default_src :self # policy.style_src :self # policy.font...

...inserts a script tag programmatically (for example a third-party chat widget or similar), the strict-dynamic will permit this. Livereload Any setup using rack-livereload will probably break, since...

...auto-generated bootstrap with your own Important: Keep TestBed options aligned with CLI defaults (strict error checking) Note: Runs for every test execution, including ng test --include for individual specs...

Custom Entry Point with Strict Options // angular.json "test": { "options": { "main": "src/test-setup.ts" } } // src/test-setup.ts import { getTestBed } from '@angular/core/testing'; import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing'; // IMPORTANT: Custom main.ts replaces CLI's auto-generated...

Example output for bundle outdated --filter-major Other examples A useful flag is --strict as it will only list versions that are allowed by your Gemfile requirements (e.g. does...

...test, development) are easier to do. Thus --groups might also be helpful. $ bundle outdated --strict --groups Outdated gems included in the bundle: ===== Without group ===== * actioncable (newest 5.2.6, installed 5.2.4.6) * actionmailer...

...a DECIMAL field, and that number exceeds that column's precision or scale MySQL (strict mode) The database connection will throw an error. MySQL (no strict mode) Warning

...use your production application in no strict mode. DON'T! MySQL will store the closest representable value. Here are some examples for a DECIMAL with a precision of 5 and...

...known as "Excess Property Checks." It basically states that "fresh" objects are checked more strictly, so their exact shape must match. This applies to both assigning a typed object to...

...basic premise that objects with the same shape are compatible. On the other hand, strict checks can be bypassed easily by using an intermediate variable. Originally, this feature was added...

When you load a with a nonce, that script can await import() additional sources from any hostname. The nonce is propagated automatically for the one purpose of importing more scripts. This is not related to strict-dynamic, which propagates nonces for any propose not limited to imports (e.g. inserting elements). Example We have a restrictive CSP that only allows nonces: Content-Security-Policy: default-src 'none'; script-src 'nonce-secret123' Our HTML loads script.js using that nonce: Our script.js imports other.js without a nonce: let other = await import('other.js') console.log("Look, script.js has imported %o", other) The import succeeds without a nonce, due to implicit nonce propagation. Why this is useful In modern build pipelines, code splitting (chunking) is implemented using dynamic imports. Nonce propagation allows us to use automatic chunking with restrictive, nonce-based CSPs without using strict-dynamic. E.g. esbuild automatically groups dynamically imported modules into chunks, and writes that chunk to disk. The compiled build has an await import('assets/chunk-NAXSMFJV.js'). There's no way to inject a nonce into that import(), but implicit nonce propagation still allows the request. Should I worry about this? It would require some truly strange code for user input to make it into an import() argument. I wouldn't lose sleep over this. Is this a browser bug? It is by design. Here are some sources: HTML Spec Section 8 (Web Application APIs) (search for "descendant script fetch options") Chromium test ensuring none propagation Firefox bug implementing nonce propagation CSP issue: Someone concerned about propagation being a vulnerability CSP issue: Proposal for import-src that went nowhere Are other CSP sources also propagated? No, only nonces. In particular host-based CSPs do not propagate trust. For example, you only allow scripts from our own host (no nonces): Content-Security-Policy: default-src 'none'; script-src 'self' Our HTML loads script.js from our own host: Our script.js imports other.js from a different host: let other = await import('https://other-host.com/other.js') This fails with a CSP violation: Executing inline script violates the following Content Security Policy directive 'script-src 'self''

...this line in your config/cucumber.yml: std_opts = "-r features --format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" Change it to: std_opts = "-r features --format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict...

makandra dev

cucumber: # ... script: - main_cucumber_run_passed=true - bundle exec rake "knapsack:cucumber[--strict --tags 'not @real-stripe-requests' -f progress -f rerun -o tmp/failing_features.txt]" || main_cucumber_run_passed...

...then (echo -e "\033[0;33mRerunning failed tests:\033[0m"; bundle exec cucumber @tmp/failing_features.txt --strict --tags "not @real-stripe-requests" -f pretty -f junit -o tmp/artifacts/reports); fi' Alternatives to consider...

...with "method semantics", called lambdas lambdas They behave like Ruby method definitions: They are strict about their arguments. return means "exit the lambda" How to define a lambda

...can send potentially dangerous files with an inline disposition iff you also send a strict CSP rule: response['Content-Security-Policy'] = "default-src 'none'" send_file svg_attachment.path, disposition: :inline

...are not supported out of the box Let's say, you want to be strict about things and do not trust a user to name their files correctly. You might...

...changes how MySQL behaves. The SQL mode value is comprised of multiple flags like "STRICT_TRANS_TABLES, NO_ZERO_IN_DATE". Each flag activates or disables a particular behavior.

...of MySQL and MariaDB. In general, more recent versions of MySQL and MariaDB have stricter settings than older versions, and MySQL has stricter settings than the more liberal MariaDB.

...method arguments are things like classes, regexps or ranges. If you want to expect strict equality, you could use expect(subject).to receive(:foo).with(eq(MyClass)) or expect(subject...

...e.g. lib/github_client, which isolates this code from other logical units. There should be a strict interface between the code in e.g. app/models/ and the lib/github_client. You can think of it...

...with a similarity score above 0.3. You can tune the threshold: Closer to 1.0 = stricter match Closer to 0.0 = looser match Ordering by best match User .where("similarity(name...

...given technology stack and use case. See also Using attribute event handlers with a strict Content Security Policy (CSP...

getbootstrap.com

...with the size of the project and its structure. If your stylesheets already follow strict rules, it may take less time to adapt them to the new version. Preparation

...There is no way around that! Phase 2 - Migration guide You can keep very strictly to the official migration guide and should follow it bit by bit. Many classes have...