Skip to content

Tags: patrickms2/php-crud-api

Tags

v2.12.6

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update Dockerfile

v2.12.5

update

v2.12.4

fix for mevdschee#794

v2.12.3

fix for mevdschee#789

v2.12.2

Merge branch 'main' of github.com:mevdschee/php-crud-api into main

v2.12.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update README.md

v2.12.0

API key support

v2.11.5

build for mevdschee#777

v2.11.4

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update XsrfMiddleware.php (mevdschee#777)

As described here: mevdschee#776 (comment), I couldn't get the XsrfMiddleware to work.
Debugging extensively, I found two issues:

1) My front-end (Angular / httpClient) wasn't able to detect the XSRF-TOKEN Cookie, because its "path" value was not "/". Because of that, it did not send the X-XSRF-TOKEN Header. Setting the Cookie "path" value to "/" via XsrfMiddleware/getToken solved this problem.

2) When sending X-XSRF-TOKEN:	9aead2ceb0e150e1 in the Header, $request->getHeader($headerName) returns an Array ( [0] => 9aead2ceb0e150e1 ) - at least in my test cases. So "$token != $request->getHeader($headerName)" was always false. Changing the condition to "$token != $request->getHeader($headerName)[0]" solved this problem.

Tested with Mozilla Firefox 86.0.1 and Google Chrome Version 89.0.4389.72 (both on Linux).
Of course, I don't know if these changes have any unwanted side effects or will work in all environments.

v2.11.3

rebuild for mevdschee#772