Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!.
Score of 5

How to create a CSP nonce and yet continue website caching?

tl;dr: you can keep caching responses with nonces in them like you normally would, and CSP will still provide a strong defense against common XSS attacks. This is an interesting question: when a page ...
Score of 3
Accepted

Why must the XHR status be set before echoes in PHP?

When you print anything on the body, headers must be already sent. That's if you e.g. echo() something or even if there's a space before the <?php. A web server simply can't output anything before ...
Score of 2

telnet to port 80 (nginx), with forward to apache2 at port 8080, fails with 'connection closed by foreign host' and no explanations seemingly anywhere

HTTP/2 is usually supported by web browsers in combination with encryption so not something you would enable on the plain HTTP port, port 80. So you nginx configuration: server { listen 80 http2; ...
Score of 2
Accepted

nginx connection refused while connecting to upstream

You're getting this error message because your Sinatra application is not listening on the default IPv6 address for localhost, ::1, but is instead listening on the legacy IPv4 address, 127.0.0.1. ...
Score of 2
Accepted

PHP unable to identify sqlsrv_connect() function while trying to connect SQL Server

You have PHP Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() because sqlsrv module wasn't loaded. The module wasn't loaded because it is compiled with module API=20200930 ...
Score of 2
Accepted

CORS prevent js window.onerror from subdomain reporting informations

From the same documentation: If the server sends a response with an Access-Control-Allow-Origin value that is an explicit origin (rather than the "*" wildcard), then the response should ...
Score of 1

Improve web page load time (JavaScript file server)

For your users, the wait time is the sum of the time it takes to Serve the files from your host, Transfer them across the network, and Interpret and run them on the client. Your question focuses on #...
Score of 1

Getting 404 on a specific path /pricing with Apache server

I find this to be curious behavior. But if you have a RewriteRule in the <VirtualHost *:443>, then you should also have RewriteEngine On. Are there any symbolic links in your directory at all. ...
Score of 1
Accepted

How to append into next line in Windows batch file

Add echo. after each mongosh to append a carriage return after each line. mongosh --host 10.1.0.1:27017 --username "username" --password "password" --authenticationDatabase ...
Score of 1

PHP unable to identify sqlsrv_connect() function while trying to connect SQL Server

I think https://github.com/microsoft/msphpsql/releases/download/v5.10.0-beta2/Windows-8.1.zip is what you need. try these in your php.ini extension=php_pdo_sqlsrv_81_ts.dll extension=php_sqlsrv_81_ts....
Score of 1

What is right syntax for nginx sub_filter directive when string has ambiguous characters?

Ok, this is entirely my mistake (comes from not being a coder). I was using chrome's developer tools to look at the desktop.js file the browser downloaded using the preview function in the network tab ...
Score of 1

crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash function

The salt parameter is optional. However, crypt() creates a weak hash without the salt, and raises an E_NOTICE error without it. Make sure to specify a strong enough salt for better security. function ...
Score of 1

Cloudfront disrupting authentication with JSON Web Token

If you are sending your JWT in a header, then your assumption was right, you have to tell CloudFront to forward the header to the origin. It can be achieved by changing Cache Based on Selected Request ...
Score of 1

Renaming the index.html on Google App Engine

Edited Answer: The issue that you aren't able to rename index.html on App Engine is because of the cached files and because you've your app.yaml file wrong. An easy way to avoid the cached file issue ...

Only top scored, non community-wiki answers of a minimum length are eligible