Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SukkoPera/Webbino
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkoPera committed Jun 17, 2023
2 parents 95973f1 + 34f5fbd commit 6730c36
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ You should have received a copy of the GNU General Public License along with Web
Please use the [official github page](https://github.com/SukkoPera/Webbino) to report issues, suggestions and such.

## Thanks
Thanks to gpb01 for Teensy 4.1 support and other contributions.
Thanks to [gpb01](https://github.com/gpb01) for [Teensy 4.1](https://www.pjrc.com/store/teensy41.html) support and other contributions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Webbino
version=0.9.97
version=0.9.98
author=SukkoPera <[email protected]>
maintainer=SukkoPera <[email protected]>
sentence=Advanced webserver for Arduino
Expand Down
7 changes: 7 additions & 0 deletions src/WebbinoCore/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define REDIRECT_HEADER "Location: "
//~ #define NOCACHE_HEADER "Pragma: no-cache
#define CONT_TYPE_HEADER "Content-Type: "
#define ACCESS_CONTROL_ALLOW_ORIGIN "Access-Control-Allow-Origin: *"
#define HEADER_END "\r\n"

#ifdef ENABLE_HTTPAUTH
Expand Down Expand Up @@ -294,6 +295,12 @@ void WebServer::handleClient (WebClient& client) {
client.print (F(CONT_TYPE_HEADER));
client.print (PSTR_TO_F (contType.getType ()));
client.print (F(HEADER_END));

if(ALLOW_CROSS_ORIGIN){
client.print (F(ACCESS_CONTROL_ALLOW_ORIGIN));
client.print (F(HEADER_END));
}

client.print (F(HEADER_END));

sendContent (client, content, contType);
Expand Down
5 changes: 5 additions & 0 deletions src/webbino_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ const byte TAG_CHAR = static_cast<byte> ('$');
*/
#define CLIENT_TIMEOUT 2500

/*
* Set the Access-Control-Allow-Origin response header to wildcard (allow cross origin).
* Set to 1 t enable.
*/
#define ALLOW_CROSS_ORIGIN 0

/* FIFTH: choose if you want to see on the serial terminal the Debug messages
* --------------------------------------------------------------------------
Expand Down

0 comments on commit 6730c36

Please sign in to comment.