Code Monkey home page Code Monkey logo

caddy-frankenphp-issue's Introduction

Caddy / FrankenPHP issue

This sample should help to reproduces an issue with frankenphp/caddy. On sending request data to PHP, it's truncated somewhere.

I'm just using frankenphp for a simple Symfony-based API application. One of these REST endpoints receives larger JSON data as POST request.

Unfortunately the 3964. and all following characters are truncated from the php://input which results into an invalid JSON string.

By using the Symfony CLI web-server / php -s I don't see that strange behavior. I ported the application from Nginx/PHP-FPM to frankenphp. The previous setup works as expected, too.

So, not sure, if this is a issue in caddy and/or frankenphp implementation or some strange configuration fuckup.

dunglas/frankenphp#182

Files

  • Dockerfile to build frankenphp/php container
  • Caddyfile simplest possible setup for frankenphp
  • docker-compose.yml start a simple test environment
  • public/index.php simple php script just to receive request data and deserializes json data to an array
  • test.sh send request.json via curl to server to demonstrate that issue

How to setup

docker compose build

How to reproduce

./test.sh

It's broken...

NOW: Remove exactly ONE character in request.json and re-run ./test.sh - it's working!

caddy-frankenphp-issue's People

Contributors

dennisoehme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.