The Movie Database-støtte

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 svar (på side 1 av 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! :-)

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p åpne profilmenyen
esc lukk et åpent vindu
? open keyboard shortcut window

On media pages

b gå tilbake (eller til foreldresiden når mulig)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Innstillinger

Vil du vurdere eller legge til dette elementet i en liste?

Logg inn