Flask,CORS和send_file不起作用

时间:2016-07-14 16:10:50

标签: python ajax flask cors sendfile

我正在尝试使用Flask的send_file函数提供jpeg文件,Google Chrome正在向我显示以下消息:“来自X的图像已被阻止通过跨源资源共享策略加载:否'访问 - Control-Allow-Origin'标头出现在请求的资源上。“

这个错误似乎与send_file函数有关。其他功能,如jsonify工作正常。以下是与错误相关的行:

public override async void OnAppearing()
{
   base.OnAppearing();

   // Show your overlay
   overlay.IsVisible = true;
   Clublistview.IsVisible = false;

   // Load the items into the ItemsSource
   await setClubs(Clublistview);

   // Hide the overlay
   overlay.IsVisible = false;
   Clublistview.IsVisible = true;
}

0 个答案:

没有答案