Skip to content

OpenUI5's legacy tooling breaks when linking to @ui5/server 1.1.0 #341

@codeworrior

Description

@codeworrior

Expected Behavior

When I link from openui5 to the latest release of the ui5-tooling, I expect that grunt serve continues to work.

Current Behavior

grunt serve starts but fails for each request and responds with an error stack trace (see below).
I unfortunately caused the issue myself with PR SAP/ui5-server#179 as I relied on express APIs in the csp middleware (request.path and request.params). But in the context of grunt serve, express is obviously not used and the APIs are missing.

Steps to reproduce the issue

  1. Clone openui5 and ui5-tooling
  2. Link from openui5 to @ui5/server at least
  3. Run grunt serve and open any HTML page

Affected components (if known)

Log Output / Stack Trace

TypeError: Cannot read property 'endsWith' of undefined
    at csp (/SAPDevelop/sapui5-dist/openui5/node_modules/@ui5/server/lib/middleware/csp.js:40:41)
    at call (/SAPDevelop/sapui5-dist/openui5/node_modules/connect/index.js:239:7)
    at next (/SAPDevelop/sapui5-dist/openui5/node_modules/connect/index.js:183:5)
    at /SAPDevelop/sapui5-dist/openui5/grunt/config/connect.js:130:7
    at call (/SAPDevelop/sapui5-dist/openui5/node_modules/connect/index.js:239:7)
    at next (/SAPDevelop/sapui5-dist/openui5/node_modules/connect/index.js:183:5)
    at Function.handle (/SAPDevelop/sapui5-dist/openui5/node_modules/connect/index.js:186:3)
    at Server.app (/SAPDevelop/sapui5-dist/openui5/node_modules/connect/index.js:51:37)
    at emitTwo (events.js:126:13)
    at Server.emit (events.js:214:7)
    at parserOnIncoming (_http_server.js:602:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions