adonisjs / transmit

A Server-Sent-Event module for AdonisJS
MIT License
72 stars 6 forks source link

Transmit issue with HTTPS call #34

Open Sancho66 opened 2 weeks ago

Sancho66 commented 2 weeks ago

Package version

1.0.2

Describe the bug

Hello guys,

When when I try to create a transmit instance like that with https baseUrl in the frontend :

transmitInstance = new Transmit({
            baseUrl: 'https://www.mydomain.com', 
            beforeSubscribe: (request) => {
                request.headers.append('Authorization', `Bearer ${authStore.token}`);
            }
        });

The backend doesn't return any response. When I have an http url (baseUrl) in local or deployed all work properly. I also checked my cors :

import { defineConfig } from '@adonisjs/cors'

/**
 * Configuration options to tweak the CORS policy. The following
 * options are documented on the official documentation website.
 *
 * https://docs.adonisjs.com/guides/security/cors
 */
const corsConfig = defineConfig({
  enabled: true,
  origin: true,
  methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'],
  headers: true,
  exposeHeaders: [],
  credentials: true,
  maxAge: 90,
})

export default corsConfig

I don't really know if it's linked with the https protocol...can you help us ?

Reproduction repo

No response

Dogson commented 3 days ago

Hello ! Do your event request stays in a pending state ? If so, I seem to have the same problem, it happens occasionnally and I don't know why.

RomainLanz commented 1 hour ago

Hey both! 👋🏻

Are you sure this is not linked to https://github.com/adonisjs/transmit/issues/31?