CORS header ‘Access-Control-Allow-Origin’ does not match… but it does‼

I wrestled with this same problem for hours, and discovered that I had added a forward slash to the end of my origin: https://foo.com/, when it should have been https://foo.com. (Talk about a major face-palm moment!) My (now working) Express Node.JS setup: const express = require(‘express’); const cors = require(‘cors’); const app = express(); app.use(cors({ … Read more

Simple HTTP server for logging requests only [closed]

For some super simple alternatives, there’s netcat: $ nc -l -p 8080 And python’s inbuilt: $ python -m SimpleHTTPServer 8080 (In recent versions of python, 3?) this is now: $ python -m http.server 8080 Netcat won’t serve responses so you may not get too far, SimpleHTTPServer won’t show POST requests (at least). But occasionally I … Read more

Multiple Set-cookie headers in HTTP

RFC 6265 section 4.1.2 states: If the user agent receives a new cookie with the same cookie-name, domain-value, and path-value as a cookie that it has already stored, the existing cookie is evicted and replaced with the new cookie. Notice that servers can delete cookies by sending the user agent a new cookie with an … Read more

HTTP headers “Accept” and “Content-Type” in a REST context

The difference can be found in the specifications, in this case RFC 7231: 5.3.2. Accept The “Accept” header field can be used by user agents to specify response media types that are acceptable. 3.1.1.5. Content-Type The “Content-Type” header field indicates the media type of the associated representation The Accept header always indicates what kind of … Read more

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