ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Apache Configuration for OPTIONS Request

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apache Configuration for OPTIONS Request

    Hello,
    I have an Angular front-end application that calls a RPGLE program which uses DATA-INTO op-code with Scott Klement's YAJLINTO parser.
    I do have the following Apache configuration:
    Code:
    DirectoryIndex index.html
    <Directory />
    Order Deny,Allow
    Allow From all
    LimitRequestBody 10242880
    </Directory>
    
    <Directory /www/web/htdocs>
    LimitRequestBody 10242880
    Order Allow,Deny
    Allow From all
    Header set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "POST,GET,OPTIONS,DELETE,PUT"
    Header always set Access-Control-Max-Age "3600"
    Header always set Access-Control-Allow-Headers "Content-Type,Authorization"
    </Directory>
    
    <Directory /www/web/htdocs/data>
    LimitRequestBody 10242880
    Order allow,deny
    allow From all
    Header set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "POST,GET,OPTIONS,DELETE,PUT"
    Header always set Access-Control-Max-Age "3600"
    Header always set Access-Control-Allow-Headers "Content-Type,Authorization"
    </Directory>
    
    <Directory /www/web/htdocs/assets>
    LimitRequestBody 10242880
    Order allow,deny
    allow From all
    Header set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "POST,GET,OPTIONS,DELETE,PUT"
    Header always set Access-Control-Max-Age "3600"
    Header always set Access-Control-Allow-Headers "Content-Type,Authorization"
    </Directory>
    
    # CGI PEXTCD2LIB User CGI Library
    The Angular application performs an OPTIONS request to start with and then a POST request.
    I would like to know if there is a way to configure APACHE in order that APACHE itself will provide success or forbidden response without calling RPGLE program.


    In RPGLE program , using DATA-INTO op-code I don't' know which HTTP Request Method has been invoked, either OPTIONS or POST.



Working...
X