D
D
Denis Sayfutdinov2019-04-22 19:20:13
safari
Denis Sayfutdinov, 2019-04-22 19:20:13

What could be causing server connection drop in safari?

Comrades, help for 3 days now I can’t understand what safari doesn’t like
, this is the answer from the server:
(ActionController::Live is used)

response.headers['Content-Type'] = 'text/event-stream'
    action = params[:user_action] || :export
    loader = @user_document.loader(action)
    @redis = Redis.new(host: '127.0.0.1', port: 6379, db: 0)
    @redis.subscribe(loader.key) do |on|
      on.message do |event, data|
        if data.blank? || data.to_i == 100
          response.stream.write "data: #{data}\n\n"
          @redis.unsubscribe(loader.key)
        end

        response.stream.write "data: #{data}\n\n"
      end
    end

listening to the response (client):
inLoadFromServer() {
progressProgressBar = 0;
    let source = new EventSource('progress_upload'),
        increase_on;
    source.onmessage = function(e) {
}
}

if we send a request to the server and start listening to the inLoadFromServer response in Google Chrome, everything works, as soon as we start checking through safari everything starts to collapse when a request is made to the server, an error is detected in the browser, the frame loading has stopped, it does not enter onmessage. The server first sends responses, but then stops and says an internal server error + Client disconnected. How to solve the problem? in safari everything is done in a special way than in other browsers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vayladion Gognazdiak, 2019-04-23
@densssov

I also encountered this unknown ebanina. Failed to win. As a result, he left for WS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question