Skip to content

Instantly share code, notes, and snippets.

@tranchausky
Last active March 25, 2025 11:50
Show Gist options
  • Save tranchausky/55cb5d78576694ede291386fffa8a114 to your computer and use it in GitHub Desktop.
Save tranchausky/55cb5d78576694ede291386fffa8a114 to your computer and use it in GitHub Desktop.

Test cross

tranc@DESKTOP-SBDJJJT MINGW64 ~
$ curl -i -X OPTIONS http://192.168.1.33:21680/completed/704_59_0/2025/03/1742835485.ts
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.1 200 OK
Date: Tue, 25 Mar 2025 11:41:19 GMT
Server: Apache/2.4.62 (CentOS Stream)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Allow: HEAD,GET,POST,OPTIONS,TRACE
Content-Length: 0
Content-Type: text/vnd.trolltech.linguist

Fix cross apache

DocumentRoot /www/wwwroot/chautest1.test
<Directory "/www/wwwroot/chautest1.test">
    Options None
    Require all granted
    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
    Header always set Access-Control-Allow-Headers "Content-Type, Authorization, x-api-id"
</Directory>
ServerName 192.168.1.33
Header always set Access-Control-Allow-Headers

Header always set Access-Control-Allow-Headers add some header input if have error cross

restart

systemctl restart httpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment