Serve Signal K discovery over HTTP and keep WebSocket on stream mount #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Fix HTTP response literal | |
| on: | |
| pull_request: | |
| types: [edited] | |
| permissions: | |
| contents: write | |
| jobs: | |
| fix: | |
| if: github.head_ref == 'fix/signalk-http-discovery' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: fix/signalk-http-discovery | |
| - name: Fix response literal | |
| run: | | |
| python3 - <<'PY' | |
| from pathlib import Path | |
| p = Path('modules/async-event-loop/src/async_event_loop/websocket_server.hpp') | |
| s = p.read_text() | |
| start = s.index(' static constexpr char NotFound[] =') | |
| end = s.index(' (void)write_all', start) | |
| replacement = ''' static constexpr char NotFound[] =\n "HTTP/1.1 404 Not Found\\r\\n"\n "Content-Length: 0\\r\\n"\n "Connection: close\\r\\n"\n "\\r\\n";\n''' | |
| p.write_text(s[:start] + replacement + s[end:]) | |
| PY | |
| rm .github/workflows/fix-http-response-literal.yml | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| git add -A | |
| git commit -m "Fix HTTP 404 response literal" | |
| git push origin HEAD:fix/signalk-http-discovery |