Assistance de TMDB

Hi,

When using the api directly from the browser, it works, but limit headers cannot be read, getting: Refused to get unsafe header "X-RateLimit-Limit"

If setting request header: "Access-Control-Expose-Headers": "X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset",

Browser performs an OPTIONS request, which fails.

Help?

6 réponses (sur la page 1 sur 1)

Jump to last post

Hi @danelkhen I thought I had exposed the methods in the OPTIONS request... I'll have to take a look at this.

Hi Travis, thanks for the quick reply!

If I recall correctly, I did notice some OPTIONS methods that worked, but I believe it happened mostly on POST requests only. Maybe it needs to be tested when the request contains the "Access-Control-Expose-Headers" header as well.

Another possible issue I found, when performing a specific multiSearch for query "the muppets", server fails with lua exception info: url: https://api.themoviedb.org/3/search/multi?api_key=xxx&language=en-US&query=the%20muppets&page=1&include_adult=false

response: <!DOCTYPE HTML>

Error body { color: #222; background: #ddd; font-family: sans-serif; margin: 20px; }
    h1, h2, pre {
      margin: 20px;
    }

    pre {
      white-space: pre-wrap;
    }

    .box {
      background: white;
      overflow: hidden;
      box-shadow: 1px 1px 8px gray;
      border-radius: 1px;
    }

    .footer {
      text-align: center;
      font-family: serif;
      margin: 10px;
      font-size: 12px;
      color: #A7A7A7;
    }
  </style></head><body><div class="box"><h1>Error</h1><pre>...rrent/cache/luarocks/share/lua/5.1/lapis/application.lua:396: ...oyed/tmdb-lua-api/current/models/elasticsearch/movie.lua:179: attempt to index field &#039;_source&#039; (a nil value)

stack traceback: ...oyed/tmdb-lua-api/current/models/elasticsearch/movie.lua: in function 'result' ...yed/tmdb-lua-api/current/models/elasticsearch/person.lua:113: in function 'map_known_for_by_ids' ...yed/tmdb-lua-api/current/models/elasticsearch/person.lua:131: in function 'result' ...oyed/tmdb-lua-api/current/models/elasticsearch/multi.lua:175: in function 'results' ...deployed/tmdb-lua-api/current/applications/v3/search.lua:130: in function <...deployed/tmdb-lua-api/current/applications/v3/search.lua:116>

Traceback

stack traceback:
    [C]: in function 'error'
    ...rrent/cache/luarocks/share/lua/5.1/lapis/application.lua:396: in function 'handler'
    ...rrent/cache/luarocks/share/lua/5.1/lapis/application.lua:130: in function 'resolve'
    ...rrent/cache/luarocks/share/lua/5.1/lapis/application.lua:161: in function <...rrent/cache/luarocks/share/lua/5.1/lapis/application.lua:159>
    [C]: in function 'xpcall'
    ...rrent/cache/luarocks/share/lua/5.1/lapis/application.lua:159: in function 'dispatch'
    ...api/current/cache/luarocks/share/lua/5.1/lapis/nginx.lua:214: in function <...api/current/cache/luarocks/share/lua/5.1/lapis/nginx.lua:212>

Cool, thanks for the info. I'll have a look at this on Monday when I get back to work.

Cheers.

By the way, the rate limit headers should now be readable properly. thumbsup

Great thanks! :-)

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion