CORS – localhost as allowed origin in production

I’m assuming you have Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: https://localhost The risk is that any services running on a user’s machine could effectively bypass the Same Origin Policy for your site. So if you have a REST URL such as https://example.com/User/GetUserDetails A malicious or compromised service running on the user’s computer could make that request via the … Read more

Semicolon as URL query separator

The W3C Recommendation from 1999 is obsolete. The current status, according to the 2014 W3C Recommendation, is that semicolon is now illegal as a parameter separator: To decode application/x-www-form-urlencoded payloads, the following algorithm should be used. […] The output of this algorithm is a sorted list of name-value pairs. […] Let strings be the result … Read more

Nginx location “not equal to” regex

According to nginx documentation there is no syntax for NOT matching a regular expression. Instead, match the target regular expression and assign an empty block, then use location / to match anything else So you could define something like location ~ (dir1|file2\.php) { # empty } location / { rewrite ^/(.*) http://example.com/$1 permanent; }

Why use Mongrel2?

If you could only name one thing then it would be that Mongrel2 is build around ZeroMQ which means that scaling your web server has never been easier. If a request comes in, Mongrel2 receives it (nothing unusual here, same as for NginX and any other httpd). Next thing that happens is that Mongrel2 distributes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)