IdHTTPServer允许跨域访问

IdHTTPServer允许跨域访问

procedure TMain.idHttpServerCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; 
    AResponseInfo: TIdHTTPResponseInfo);
begin
    AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Origin:*');
    AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Headers:*');
    AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Method:*');
end;

  

posted @ 2019-07-29 09:12  delphi中间件  阅读(1818)  评论(0编辑  收藏  举报