Skip to content
This repository was archived by the owner on Feb 13, 2022. It is now read-only.
This repository was archived by the owner on Feb 13, 2022. It is now read-only.

API returns 'Not Found' after first request on v1.7.9  #556

Description

@leyume

Hello @leocavalcante
Thank you for Siler.

There's this strange issue with v1.7.9
API returns 'Not Found' after first request with Siler Swoole

This worked fine up to version 1.7.8


Simple code to recreate

index.php

<?php 
declare(strict_types=1);
require_once 'vendor/autoload.php';

use Siler\Swoole;
use Siler\Route;

$server = function () {
    Swoole\cors( '*', 'Authorization, Content-Type', 'GET,POST,PUT' );

    try {
        Route\files('api');
    } catch (Exception $e) {
        Resource::error($e->errorInfo[2]);
    }
    
    Swoole\emit('Not found', 404);
};

Swoole\http($server)->start();

Then, api/get.php

<?php
use Siler\Swoole;

return function () {
    Swoole\json( ['greet'=>'Hello', 'name'=>'Leo'] );
};

Request API more than once. You would see the "Not Found"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions