Home / File/ cors.html — netty Source File

cors.html — netty Source File

Architecture documentation for cors.html, a html file in the netty codebase.

Entity Profile

Source Code

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Cross Origin Resource Sharing (CORS) Example</title>
        <link rel="stylesheet" href="css/cors.css">
    </head>
    <body onload="simpleGetRequest();">
        <h1>Response from Server</h1>
        <textarea id="responseText"></textarea>
        <script>
            function simpleGetRequest() {
                var xhr = new XMLHttpRequest();
                xhr.open('GET', 'http://localhost:8080/cors');

                // Uncomment to force a CORS preflight request.
                //xhr.setRequestHeader('custom-request-header', 'dummy value');

                xhr.onerror = function() {
                    getTextAreaElement().value = 'CORS is NOT working';
                };

                xhr.onload = function() {
                    getTextAreaElement().value = 'CORS is working';
                    //var header = xhr.getResponseHeader("custom-response-header");
                    //appendTextArea('custom-response-header=' + header);
                };

                function getTextAreaElement() {
                    return document.getElementById('responseText');
                }

                function appendTextArea(newData) {
                    var el = getTextAreaElement();
                    el.value = el.value + '\n' + newData;
                }

                xhr.send();
            }
        </script>
    </body>
</html>

Frequently Asked Questions

What does cors.html do?
cors.html is a source file in the netty codebase, written in html.
Where is cors.html in the architecture?
cors.html is located at example/src/main/resources/cors/cors.html (directory: example/src/main/resources/cors).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free