Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provided Origin "capacitor://localhost" is an invalid #40

Closed
lorenzhh opened this issue Apr 21, 2022 · 1 comment
Closed

Provided Origin "capacitor://localhost" is an invalid #40

lorenzhh opened this issue Apr 21, 2022 · 1 comment
Labels
Duplicate This issue or pull request already exists

Comments

@lorenzhh
Copy link

lorenzhh commented Apr 21, 2022

Bug Report

Mezzio\Cors\Exception\InvalidOriginValueException raised in file /vendor/mezzio/mezzio-cors/src/Exception/InvalidOriginValueException.php in line 21 with message: Provided Origin "capacitor://localhost" is invalid.

Q A
Version(s) 1.3.0

Summary

While running IOS Simulator in XCode, An Exception is raised from the mezzio-cors package.

Current behavior

The exception is raised on every request comes from the cliend side (XCode Simulator). mezzio-cors claims that capacitor://localhost is invalid origin

How to reproduce

in pipeline.php

use Mezzio\Cors\Middleware\CorsMiddleware;

$app->pipe(CorsMiddleware::class);

Expected behavior

Should be able to add the capacitor://localhost to the allowed origins

return [
    ConfigurationInterface::CONFIGURATION_IDENTIFIER => [
        'allowed_origins' => ['capacitor://localhost', 'http://localhost'],
        'allowed_headers' => ['Content-Type', ' Access-Control-Allow-Headers', 'Authorization'],
        'allowed_max_age' => '3600',
        'credentials_allowed' => true,
        'exposed_headers' => []
    ],

PS. This is my first bug report ;)

@lorenzhh lorenzhh added the Bug Something isn't working label Apr 21, 2022
@boesing
Copy link
Member

boesing commented Apr 21, 2022

The limitation does not come from this component.
It comes from the PSR-7 implementation and thus needs to be addressed there.

Closing this as duplicate of #37.

@boesing boesing closed this as completed Apr 21, 2022
@boesing boesing added Duplicate This issue or pull request already exists and removed Bug Something isn't working labels Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants